km0 2 years ago
parent 0ce1248a8c
commit 48c2580de4

@ -11,13 +11,11 @@ const PUBLIC = process.env.PUBLIC || "";
const router = express.Router(); const router = express.Router();
const routes = (app) => { const routes = (app) => {
app.get("/", (req, res) => { app.get("/", (req, res) => {
// res.sendFile("index.html", { root: __dirname });
res.render("index", { res.render("index", {
address: PREFIX, address: PREFIX,
}); });
}); });
app.get("/destination", (req, res) => { app.get("/destination", (req, res) => {
// res.sendFile("destination.html", { root: __dirname });
res.render("destination", { res.render("destination", {
address: PREFIX, address: PREFIX,
}); });

@ -33,7 +33,7 @@
const container = document.querySelector("#svg-container"); const container = document.querySelector("#svg-container");
const socket = new ReconnectingWebSocket( const socket = new ReconnectingWebSocket(
location.origin.replace(/^http/, "ws") + "{{location}}" location.origin.replace(/^http/, "ws") + "{{address}}"
); );
socket.onopen = (event) => { socket.onopen = (event) => {
socket.send(JSON.stringify({ type: "hello" })); socket.send(JSON.stringify({ type: "hello" }));

@ -41,7 +41,7 @@
erase.addEventListener("click", () => deletePath()); erase.addEventListener("click", () => deletePath());
const socket = new ReconnectingWebSocket( const socket = new ReconnectingWebSocket(
location.origin.replace(/^http/, "ws") + "{{location}}" location.origin.replace(/^http/, "ws") + "{{address}}"
); );
socket.onmessage = (event) => { socket.onmessage = (event) => {

Loading…
Cancel
Save