Servie Route
Simple route middleware for Servie using Path-To-Regexp.
Installation
npm install servie-route --save
Usage
The package exposes common HTTP methods: get
, head
, put
, post
, patch
, del
, and options
.
;; ; ;
Composition
If you need raw control, the package also exposes the internally used functions: method
and path
.
method(method, fn)
- Match an incoming request against a HTTP method.path(path, fn, options?)
- Match an incoming request against apath-to-regexp
path.
TypeScript
This project is written using TypeScript and publishes the definitions directly to NPM.
License
Apache 2.0