I am using Node.js Express with socket.io.
//app.js
var server = http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});
var io = require('socket.io').listen(server,{'log level': 1});
and if I want to do "io.sockets.emit" only for people watching index page which is provided by index.js how can I call "io.sockets.emit" in index.js other than using "require" for app.js(main file)?
I've googled about it though I couldn't find any sample source code which use socket.io in multiple files.