Skip to content
Equip connect middlewares to your flatiron stack.
JavaScript
Pull request Compare This branch is 6 commits behind jfhbrook:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
README.md
package.json

README.md

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.

Something went wrong with that request. Please try again.