1// Try this. Syntax is changed for new version of joi
2const schema = Joi.object({ name: Joi.string() .min(6) .required(),
3email: Joi.string() .min(6) .required() .email(),
4password: Joi.string() .min(6) .required() });
5
6const validation = schema.validate(req.body);
7res.send(validation);