Node.js · 14-day planAll days
Day 10 of 14 35 minRESTJSON bodiesValidation
Design and build a REST API for a list of tasks. Map create, read, update and delete to HTTP methods and paths, read JSON request bodies safely, match route parameters like /tasks/:id, validate input, and return consistent errors.
By the end of today you can
- Design REST endpoints for a resource
- Read and parse a JSON request body, with a size limit
- Match routes with parameters such as /tasks/:id
- Validate input and return 400 with helpful messages
- Return consistent status codes and error responses
What's inside
- 5 sections
- 2 diagrams and mind maps
- 3 code examples you can run
- 5-question quiz
- 1Designing the API
- 2Reading a JSON body
- 3Route parameters
- 4The complete API
- 5Never trust input
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free