0.1.3 • Published 12 years ago

equip v0.1.3

Weekly downloads
26
License
-
Repository
github
Last release
12 years ago

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.

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago