Skip to content

Instantly share code, notes, and snippets.

@blakmatrix
Created November 30, 2012 21:32
Show Gist options
  • Save blakmatrix/4178803 to your computer and use it in GitHub Desktop.
Save blakmatrix/4178803 to your computer and use it in GitHub Desktop.
app.js
======
var routes = require('./routes')
, app = express()
, server = http.createServer(app)
, io = socketio.listen(server);
app.get('/events/:shortname', routes.event);
routes/index.js
===============
var event = exports.event = function(req, res) {
// I want access to "io" here!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment