Home

Awesome

methodist

NPM version build status Test coverage Downloads js-standard-style

HTTP method matching.

Installation

$ npm install methodist

Usage

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)

API

methodist(method, default, routes)

Uses curry to allow reusable constuctors.

See Also

License

MIT