Connect light
Combine middlweware functions into a http server. Any expressjs (or connectjs) middleware can be used.
The implementation is stripped down to a bare minimum in order to make it easy to understand how things work.
var mws = require('connectlight');
mws.use('/first', function(req, res, next) {
console.log('Matched /first - got request: ', req.url);
next();
});
mws.use(function(req, res, next) {
console.log('Matched / - got request: ', req.url);
next();
});
mws.use(function(req, res, next) {
console.log('Closing response stream');
res.end();
next();
});
mws.listen(3000);