0.0.3 • Published 6 years ago

params-validate-feng v0.0.3

Weekly downloads
3
License
MIT
Repository
-
Last release
6 years ago

Introduction

params validate middleware of koa base on joi

Usage

npm install --save params-validate-feng

const app=require('koa')();
const match=require('url-match-feng');
const validate=require('params-validate-feng');
const Joi =require('joi');
const schema=Joi.object().keys({
    id:Joi.string().required()
});
const routesconfig={
     '/index': { method: 'GET', cache: 300, main: 'index', type: 'html',schema:schema },
    '/channel': { method: 'GET', cache: 200, main: 'channel', type: 'html' },
};
app.use(match({routesConfig}));
app.use(validate());

app.listen(3000);

options

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago