socket doen't work in express in routes #4001
Unanswered
jensysantana
asked this question in
Q&A
Replies: 1 comment
-
You shouldn't declare you app.get('/', async (req, res) => {
// ...
});
io.on('connection', (socket) => {
socket.on('disconnect', () => {
});
socket.emit('messagex', ({ name: 'anyname' }));
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
app.get('/', async (req, res) => {
});
Beta Was this translation helpful? Give feedback.
All reactions