My sio = require(\'socket.io\').listen(app) is in my server.js file, but I\'m calling a method in a library that would like to push a message to the client... s
sio = require(\'socket.io\').listen(app)
in server.js append this line
server.js
module.exports.sio = sio;
in api/user.js
api/user.js
sio = require('../server').sio; sio.sockets.on ...
Or did I misunderstand the question?