You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering to add socket.io on the same port, something like this.
const app = require('./index.js');
const port = process.env.PORT;
// Server
let server = app.listen(port, () => {
console.log(`Listening TCP on: http://localhost:${port}`);
});
let io = require('socket.io')(server);
console.log(` WS on: http://localhost:${port}`);
io.on('connection', (socket) => {
console.log('IO user connected');
});
I need some ideas to create routes for socket IO. I am not able to figure out that routing mechanism.
The text was updated successfully, but these errors were encountered:
Hi,
I was wondering to add socket.io on the same port, something like this.
I need some ideas to create routes for socket IO. I am not able to figure out that routing mechanism.
The text was updated successfully, but these errors were encountered: