koa-body-validator
koa-router body validator middleware based on Joi.
A simpleUsage
This package requires koa-body or an alternative body-parser that saves the parsed body in koas context object (
ctx.request.body
).
const Koa = const koaBody = const router = const Joi bodySchema = const app = app router appapp app
For more instructions on how to define the schema, see the detailed Joi API Reference.