Express: an API server

Lesson 03 · 11 min

Validating input

Don't trust the request body. Check shape, types, and limits, and only then write to the database.

11 minLesson 3 of 9Practice includedAsk AI on any point

A client can send anything: empty fields, a string instead of a number, extra keys. Checks in the frontend form are a convenience and easy to bypass. Real validation happens on the server, before you do anything with the data.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.