koa-parameter
parameter validate middleware for koa, powered by parameter.
Installation
$ npm install koa-parameter --save
Usage
const Koa = ;const parameter = ; const app = ; ; // add verifyParams method, but don't add middleware to catch the error// app.use(parameter(app)); // also add a middleware to catch the error. app;
Checkout parameter to get all the rules.
Translate
You can override the translate method of parameter to implement I18n, by passing a function like this :
const Koa = ;const parameter = ; const app = ; ; app;
Example
License
MIT