What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-11 18:47:19
how to use of socket io on a route in nodejs
//Using Express 4, in your app.js file you can use app.set('socketio', io); //then in your router you can access it like this router.post('/getRides', function(req, res, next) { var io = req.app.get('socketio'); io.to(//socket.id//).emit("m... Add solution