It seems pretty straight forward to validate user\'s input in Node.js RESTapi with Joi.
But the problem is that my app is not written in English. That m
You can use .error(new Error('message')), And its work for me
var schema = Joi.object().keys({
firstName: Joi.string().min(5).max(10).required().error(new Error('Give your error message here for first name')),
lastName: Joi.string().min(5).max(10).required().error(new Error('Give your error message here for last name'))
..
});
Joi.validate(req.body, schema, function(err, value) {
if (err) {
console.log(err.message)
return catched(err.message);
}
});