connectlight

0.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i connectlight

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • colmsjo