equip

Equip connect middlewares to your flatiron stack.

equip

Equip connect middlewares to your flatiron stack.

var equip = require('equip');
 
var flatiron = require('flatiron'),
    app = flatiron.app;
 
var hello = equip.configurable(function (world) {
  return function (reqresnext) {
    res.writeHead(200, { 'content-type': 'text/plain' });
    res.end('Hello %s!', world);
  }
});
 
app.use(flatiron.plugins.http);
app.use(hello, 'world');
 
app.start(8080);
npm install equip

Wrap middlewares for use with flatiron:

var equipped = equip.middleware(someMiddleware);
flatironApp.use(equipped);
 
flatironApp.router.get('*', equipped);
expressApp.use(equipped);

You can also wrap functions that return middlewares, here called a "configurable":

var equipable = equip.configurable(someConfigurable);
flatironApp.use(equipable, options);
 
flatironApp.router.get('*', equipable(options));
expressApp.use(equipable(options));

Tests

$ npm test

License:

MIT/X11.