Skip to content

Instantly share code, notes, and snippets.

@ritch
Created August 9, 2012 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritch/3300309 to your computer and use it in GitHub Desktop.
Save ritch/3300309 to your computer and use it in GitHub Desktop.
Extending http.Server with connect
var connect = require('connect')
, http = require('http');
var server = http.createServer(function () {
console.log('foo'); // this is logged
});
var app = connect(server);
app.use(function (req, res, next) {
console.log('bar'); // this is never called
res.end();
});
server.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment