Do not hardcode server name in Javascript files
This commit is contained in:
@@ -52,7 +52,7 @@ document.addEventListener("touchmove", (e) => {
|
||||
});
|
||||
|
||||
function sendNudge(x, y) {
|
||||
fetch("http://localhost:8080", {
|
||||
fetch("/", {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
referrer: "no-referrer",
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ document.addEventListener("mousemove", (e) => {
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
let webSocket = new WebSocket("ws://localhost:8081/socket");
|
||||
let webSocket = new WebSocket("/socket");
|
||||
webSocket.addEventListener("message", (e) => {
|
||||
let nudgeReq = JSON.parse(e.data);
|
||||
n.nudge(nudgeReq[0] / 10, nudgeReq[1] / 10);
|
||||
|
||||
Reference in New Issue
Block a user