README
A smart router middleware for Zeit's Micro, but also works well with all standard http.IncomingMessage and http.ServerResponse objects.
Installation
npm install @cloudseat/micro-router
Usage
const { route, get, post, put, del } = require('@cloudseat/micro-router')
const hello = (req, res) => {
res.end('hello')
}
const bye = (req, res) => {
res.end('bye')
}
module.exports = route(
get('/', hello),
post('/:token', bye),
// ...
)