methodist
HTTP method matching.
Installation
$ npm install methodist
Usage
const methodist = const wayfarer = const http = const server = http server
API
methodist(method, default, routes)
Uses curry to allow reusable constuctors.
- method: methods are either an HTTP verb or
http.ClientRequest
class. Methods are lowercased before matched. - default:
default()
is called if no methods match. Checks ifdefault.default()
exists for easy integration with wayfarer. - routes: Routes is an object where
the keys are one of methods,
all
orany
.all
andany
are called if no other method matches.