koa-router-param
Params Router middleware for koa-router
Installation
Install using npm:
npm install koa-router-param
API Reference
- koa-router-param(params)
- .Type
- static .Number
- .Type
Generator
KoaRouterParam(params) ⇒ Creates a middleware for koa-router route.
Parameters
Param | Type | Description |
---|---|---|
params | Object |
An object representing the processable URL params |
↳ key | String |
Name of the param in the URL |
↳ value | Generator |
A transformer for the param's value |
Example
Basic usage:
var Router = ;var routerParam = ; router ;
Generator
RouterParam.Type.Number ⇒ Casts the given parameter to Number
.
Example
Basic usage:
paramName: routerParamTypeNumber
Contributing
Please submit all issues and pull requests to the emartech/koa-router-param repository!
Tests
Run tests using npm test
.
Support
If you have any problem or suggestion please open an issue here.