Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

joi.validate is not a function

// 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);
 
PREVIOUS NEXT
Tagged: #function
ADD COMMENT
Topic
Name
2+1 =