June 2025
Intermediate to advanced
837 pages
24h 50m
English
In addition to the documentation, there is another important issue regarding our interface we’ve grossly neglected so far: validation. Currently, the application accepts all user input and writes it to the database unchecked, albeit with correct escaping. It’s also possible to create a new data record without information. This then contains only an ID and the user ID. To conclude this chapter, we’ll present the express-validator package—a fairly convenient solution for validation in Express. The validator allows you to check individual fields via middleware functions as well as a complete request via a validation scheme and to force values into a specific form with the Sanitizer feature.
Read now
Unlock full access