koa-router-joi-validator
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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!';
})

Readme

Keywords

none

Package Sidebar

Install

npm i koa-router-joi-validator

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • bermanboris