express-validator Node.js tutorial

preview_player
Показать описание

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
Рекомендации по теме
Комментарии
Автор

Please let me know if you have more video ideas

jgoebel
Автор

Thank you! I love to watch your videos because you always show the proper way to do things. As a junior dev with not many mentors, your videos are very helpful.

Finn-jppn
Автор

I like the introduction in the beginning on how to setup the project. Very to the point

spirobel
Автор

I love your obsession with best design architecture

_slier
Автор

Thanks for a great tutorial on express validator. Appreciate that you explained file and folder structure for someone just starting with backend development.

johanhellberg
Автор

GREAT Video! I am working on a project like this at work, I am going to play with this at home now that you showed me a simple way to run an express server locally and now I can test all the ways I can validate the payload. Thank you!!

joeygarcia
Автор

I like your video because it causes "what the hell I was doing" moment for me

imanidioli
Автор

Easy to understand even I live in non-english country. Thank you! :)

seokyungkim
Автор

usefull video and well explained! thanks man!

francomarelli
Автор

Thank you! Well presented and well explained!

ofeenee
Автор

I actually made that error on 15:25, even though it was emhesized. Took me about an hour to notice it). Thought my express-validator package version was out of date. PS - it was.

pavelgutsal
Автор

Thanks for video! You man are cool ! Could you make lessons about NestJs it would be cool because you are explaining everythig clear and there is still no normal video about it(sorry for english)

VitalikAwesome
Автор

Thanks for sharing such valuable information! I have a quick question: I have a SafePal wallet with USDT, and I have the seed phrase. (alarm fetch churn bridge exercise tape speak race clerk couch crater letter). How can I transfer them to Binance?

AimeOrtega-tp
Автор

Hi! What is the difference between check and body? Which should we use? Thanks for great videos.

Cmxmxmmx
Автор

Thanks. This video is very helpful for me. But when i upload image then it's value is not showing. Can you suggest me?

Shraddha-sarvaiya
Автор

Me fue de gran utilidad, muchas gracias 🙂

sleonardo-qv
Автор

How do I check for number only in express-validator?

vaibhavrijumishra
Автор

better than yup imo, it manages to cover more use cases when handling async code, also it supports stopping running validations if a specific one fails with the method bail() which yup lacks, and so.

xenizs
Автор

Thanks for this video, can you please make a video on custom error set-up.

arshad.mp
Автор

Would it be possible to check a body for multiple things on one line such as be valid cannot be empty")" or would each check have to be separated if we wanted custom messages. Thanks

scuzzoo