I\'m trying to create a really simple node API using express.js 4 but I need a few \'realtime\' events for which I added socket.io. I\'m fairly new to both so I\'m likely m
I think best way is to set io as a property of req, like below:
app.use(function(req,res,next){ req.io = io; next(); }); app.use('/your-sub-link', your-router);