fix(api): use server.listen instead of app.listen for WebSocket support
- server.ts: switch from app.listen() to server.listen() so WebSocket upgrade handler is on the same server as HTTP requests - lobbyService: add host as first player on lobby creation - ws-client: guard against reconnect when already connecting - ws-provider: skip connect if already connected
This commit is contained in:
parent
974646ebfb
commit
540155788a
4 changed files with 14 additions and 2 deletions
|
|
@ -9,6 +9,6 @@ const server = createServer(app);
|
|||
|
||||
setupWebSocket(server);
|
||||
|
||||
app.listen(PORT, () => {
|
||||
server.listen(PORT, () => {
|
||||
console.log(`Server listening on port ${PORT}`);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue