📜  joi.validate 不是函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:01.745000             🧑  作者: Mango

代码示例1
// Try this. Syntax is changed for new version of joi
const schema = Joi.object({ name: Joi.string() .min(6) .required(),
email: Joi.string() .min(6) .required() .email(),
password: Joi.string() .min(6) .required() });

const validation = schema.validate(req.body);
res.send(validation);