refactor: update WebSocket server setup and improve session handling
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user