Created
August 9, 2012 02:09
-
-
Save ritch/3300309 to your computer and use it in GitHub Desktop.
Extending http.Server with connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment