Joi validate usage

node v18.11.0
version: 1.0.0
endpointsharetweet
var joi = require("joi"); const schema = joi.object({ name: joi.string().min(3).required(), }); const fakeBody = { name: "course1" }; const result = schema.validate(fakeBody); console.log(result);
Loading…

no comments

    sign in to comment