@kobionic/koa-joi-validator
v2.0.2
Published
A Koa middleware to validate given part of a request against a Joi schema.
Downloads
76
Maintainers
Readme
Koa Joi Validator
A Koa middleware to validate given part of a request against a Joi schema.
Installation
npm install @kobionic/koa-joi-validator
Usage
import joiValidator from '@kobionic/koa-joi-validator';
import Koa from 'koa';
const app = new Koa();
app.use(
joiValidator({
body: Joi.object().keys({
email: Joi.string().email().required(),
password: Joi.string().min(8).max(128).required(),
}),
}),
);
app.listen();
Run Tests
npm test
Authors
- Jeremie Rodriguez <[email protected]> - Main developer
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.