femto-router
v0.0.9
Published
Router middleware for Femto.
Downloads
4
Maintainers
Readme
Femto Router
Router middleware for Femto.
Installation
$ npm install femto-router
Running Tests
Install dev dependencies.
$ npm install
Check code quality.
$ npm run lint
Example
'use strict';
var femto = require('femto'),
router = require('femto-router');
var app = femto();
// all get requests where the request url starts with : "/api"
app.use(router.get('/api', function (next) {
this.body = { message: 'Hello World' };
next();
}));
app.listen(process.env.PORT || 3000);
License
MIT