Gitlab NPM Twitter
Kado
High Quality JavaScript Libraries

Profiler

Introduced in 4.0.0

Stability: 2 - Stable

const Router = require('kado/lib/Router')

The Router library provides assistance for matching paths or URIs to real locations within the system.

static router.getInstance()

Router.constructor()

Router.use(fn)

Add middleware to the system to be executed before the route is called.

Router.unuse(fn)

Router.final(fn)

Replaces the final handler with this function. By default the final handler is a noop function.

Router.add(method, uri, fn)

Adds a new route to the system with the specified handler.

Router.update(method, uri, fn)

Router.remove(method, uri)

Router.get(method, uri, params)

Router.callMiddleware(req, res, middlewareKeys)

Internal Use

Router.request(req, res)

This method is typically invoked by the HyperTextServer.onRequest() method.

Router.all()

Router.allForTemplate(replaceSplashes)