RouterMiddleware 

Utility for representing and running router middleware.

Kind: global class


new RouterMiddleware(middleware) 

Initializes the middleware

Param Type Description
middleware function Middleware function accepting routeParams as a first argument, which can be mutated and locals object as second argument. This can be used to pass data between middlewares.

routerMiddleware._middleware : function 

Middleware function accepting routeParams as a first argument, which can be mutated and locals object as second argument. This can be used to pass data between middlewares.

Kind: instance property of RouterMiddleware


routerMiddleware.run([params], locals) ⇒ Promise.<void> 

Passes provided params to router middleware and runs it.

Kind: instance method of RouterMiddleware
Returns: Promise.<void> - Middleware function.

Param Type Description
[params] Object.<string, (number\|string)> The route parameter values.
locals object Object used to pass data between middlewares.