express-validator Node.js tutorial

Jan Goebel
Jan Goebel
34.6 هزار بار بازدید - 3 سال پیش - 🔥More exclusive content:
🔥More exclusive content: https://productioncoder.com/you-decid...
Twitter: Twitter: _jgoebel
Blog: https://productioncoder.com
Website: https://jangoebel.com
Code: https://github.com/productioncoder/no...

In this video, we take a look at the express-validator npm package. This package allows you to validate incoming request payloads and it allows you to check whether the payload conform to the format that you are expecting.

We cover how to create request body validation middlewares and how properly organize your project with express-validator.

00:00 express-validator project setup with Typescript
03:10 creating a express server with validation middleware
04:52 understanding express-validator chains
06:52 trying out request-validator
09:25 exists validator chain with falsy checks
12:07 moving request body validation to its own middleware
15:36 moving express validator schema checks to a separate file
18:50 moving the routes to another
21:17 customizing error messages in express-validator
22:45 conclusion
3 سال پیش در تاریخ 1400/01/09 منتشر شده است.
34,603 بـار بازدید شده
... بیشتر