Node.js · Middle · Question 33 of 75

Why validate request input on the server even if the front end already validates it?

Explanation

Validate types, lengths and formats with a schema library (Zod, JSON Schema, Valibot) at the API boundary, and reject unknown fields.

Further reading

Problem with a question

Node.js · Middle · question 33

Test yourself

Take the Node.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz