This HTTP method reads all tasks from /api/tasks.
What is GET?
Add this middleware line so Express can read JSON request bodies.
What is app.use(express.json());?
A successful POST that creates a new task should return this status code.
What is 201?
This HTTP method creates a new task.
What is POST?
In a POST route, the submitted JSON body appears on this Express object.
What is req.body?
Empty POST bodies should return this status code because the client sent bad data.
What is 400?
This HTTP method updates one task at /api/tasks/:id.
What is PUT?
In /api/tasks/:id, this part of the route is a placeholder.
What is :id?
If the route exists but the requested task id does not, return this status code.
What is 404?
This HTTP method removes one task at /api/tasks/:id.
What is DELETE?
This Express chain sends both a 400 status and a JSON error body.
What is res.status(400).json(...)?
In “the URL is the address; the method is the verb,” this part tells the server what job to do.
What is the HTTP method?
The path exists, but no task matches the id. This kind of 404 comes from this source.
What is our route handler, or our code?