koa-yup-error
v1.0.0
Published
Koa middleware to convert yup validation errors into 400 responses.
Downloads
3
Readme
koa-yup-error
Intercept yup validation errors and convert them into 400 for koa-error middleware.
Requirements
- node ^7.6.0
Installation
npm install --save koa koa-error koa-yup-error
Usage
import Koa from 'koa';
import error from 'koa-error';
import yupError from 'koa-yup-error';
// make sure to use after koa-error
const app = new Koa();
app.use(error());
app.use(yupError());
License
MIT