Lobby urls! Server will server index.html and act as a SPA.

This commit is contained in:
NewHappyRabbit
2025-02-12 21:18:23 +02:00
parent e1a6c5f7bd
commit 303543d246
7 changed files with 74 additions and 28 deletions
+9 -7
View File
@@ -14,7 +14,7 @@ import { generateCryptoRandomUUID } from "./Utils";
import { consolex } from "../core/Consolex";
import "./components/FlagInput";
import { FlagInput } from "./components/FlagInput";
import page from 'page';
import page from "page";
class Client {
private gameStop: () => void;
@@ -86,13 +86,15 @@ class Client {
}
});
page('/join/:id', (ctx) => {
// TODO: Implement logic for joining a lobby
const id = ctx.params.id;
consolex.log('join', id);
});
page("/join/:lobbyId", (ctx) => {
const lobbyId = ctx.params.lobbyId;
page();
this.joinModal.open(lobbyId);
consolex.log(`joining lobby ${lobbyId}`);
});
page();
}
private async handleJoinLobby(event: CustomEvent) {