refactor: update WebSocket server setup and improve session handling

This commit is contained in:
Giuseppe Raffa
2026-04-14 15:04:10 +02:00
parent ccd6143253
commit 8b5937fa19
3 changed files with 76 additions and 92 deletions

View File

@@ -16,8 +16,6 @@ app.use((req, res, next) => {
next();
});
require('./socket');
app.get('/', (req, res) => {
res.redirect('/health');
});
@@ -81,6 +79,8 @@ const server = app.listen(3000, '0.0.0.0', async () => {
await require('./helper/authdb').initDB();
});
require('./socket')(server);
const wss = new WebSocket.Server({ server, path: '/live' });
wss.on('connection', (client) => {