0.0.3 • Published 8 years ago

connectlight v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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);