HTTP method matching.
$ npm install methodist
const methodist = require('methodist')
const wayfarer = require('wayfarer')
const http = require('http')
const server = http.createServer((req, res) => {
const router = wayfarer()
const method = methodist(req, router)
router.on('/hello', method({
all: params => console.log('any route matches'),
get: params => console.log('get')
}))
})
server.listen(1337)
Uses curry to allow reusable constuctors.
http.ClientRequest
class. Methods are lowercased before matched.default() is called if no methods match. Checks if
default.default() exists for easy integration with
wayfarer.all or
any. all and any are called if no other method matches.