Joi Validate Middleware
Validate middleware generator using Joi(^17.0.2)
Install
$ npm i joi-validate-middleware
Usage
const Joi = ;const joiValidateMiddleware = ; const schema = params: Joiobject id: Joi body: Joiobject content: Joi ; /* orconst schema = { params: { id: Joi.number().required(), }, body: { content: Joi.string().required(), }};*/ const validate = joiValidateMiddleware; const successRequest = params: id: 1 body: content: 'test' ; ;console; const errorRequest = params: id: 'other' ; try ; console; catch e console;