equip

Equip connect middlewares to your flatiron stack.

npm install equip
25 downloads in the last month

equip

Equip connect middlewares to your flatiron stack. Build Status

Flatiron plugin example:

var equip = require('equip');

var flatiron = require('flatiron'),
    app = flatiron.app;

var hello = equip.configurable(function (world) {
  return function (req, res, next) {
    res.writeHead(200, { 'content-type': 'text/plain' });
    res.end('Hello %s!', world);
  }
});

app.use(flatiron.plugins.http);
app.use(hello, 'world');

app.start(8080);

Install:

npm install equip

API:

equip.middleware

Wrap middlewares for use with flatiron:

var equipped = equip.middleware(someMiddleware);

Flatiron plugin:

flatironApp.use(equipped);

Flatiron route handler:


flatironApp.router.get('*', equipped);

Regular middleware

expressApp.use(equipped);

equip.configurable

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

var equipable = equip.configurable(someConfigurable);

Flatiron plugin:

flatironApp.use(equipable, options);

Flatiron route handler:


flatironApp.router.get('*', equipable(options));

Regular middleware

expressApp.use(equipable(options));

Tests

$ npm test

License:

MIT/X11.

npm loves you