0.0.4 • Published 7 years ago

koa-router-joi-validator v0.0.4

Weekly downloads
42
License
MIT
Repository
github
Last release
7 years ago

Build Status codecov Known Vulnerabilities dependencies Status devDependencies Status

koa-router-joi-validator

Install:

npm i koa-router-joi-validator

if you are using yarn:

yarn add koa-router-joi-validator

Usage:

import { validator } from 'koa-router-joi-validator';

const usersSchema = {
    id: {
        type: 'number',
        options: { integer: true, max: 10 }
    },
    username: {
        type: 'string',
        options: { required: true }
    }
};

router.post('/users', validator(usersSchema), ctx => {
    ctx.body = 'Users route after validation!';
})
0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago