How To Use Joi for Node API Schema Validation ?
Validating without using any package
app.post("/api/courses", (req, res) => {
if (!req.body.name || req.body.name.length < 3) {
res.status(400).send("Name is required and should...");
return;
}
const course = {
id: courses.length +...
omarsaade.hashnode.dev2 min read