The current application has validation but only on the database. It will be cool to add validation on the application side.
This validation will catch errors directly from the req.body via a middleware and return an error response to the client.
The following npm packages can be used to implement this feature: express-joi-validation and express-validator.
The current application has validation but only on the database. It will be cool to add validation on the application side.
This validation will catch errors directly from the
req.bodyvia a middleware and return an error response to the client.The following npm packages can be used to implement this feature: express-joi-validation and express-validator.