methodist

HTTP method matching.
Installation
$ npm install methodist
Usage
const methodist = require('methodist')
const wayfarer = require('wayfarer')
const http = require('http')
const router = wayfarer()
const server = http.createServer((req, res) => {
wayfarer.on('/hello', methodist(req, {
all: params => console.log('any route matches'),
get: params => console.log('get')
}))
})
server.listen(1337)
API
methodist(req, routes)
Call a callback based on method or req.method. Routes is an object where
the keys are one of methods, all or
any. all and any are checked before other methods. Methods are normalized
to lowercase.
See Also
License
MIT