Performant radix-trie router for streaming servers.
Usage
var serverRouter = var http = var router = router router router http
API
router = serverRouter(opts)
Create a new router with opts.
router.route(method|[methods], route, function (req, res, params))
Register a new route with an HTTP method name and a routename. Can register
multiple handlers by passing an array of method names. params
contains
matched partials from the route.
router.match(req, res)
Match a route on a router.
handler = router.start()
Return a function that can be passed directly to http.createServer()
and
calls router.match()
.
Installation
$ npm install server-router
See Also
- wayfarer - vanilla radix-trie router
- nanorouter - client-side radix-trie router