- Recap last Week
- Previous homework
- Questions & answers (Q&A)
- Testing with Postman
- Express.js vs native
http
library- HTTP request method refresher
- HTTP response status code refresher
- Routing
- Example
- Building a REST API for To-Dos
- Homework
Last week we made a CLI To-Do application. This week we are going to rewrite it into an Express-based server.
Download and install Postman.
Videos:
Videos:
Documentation:
Videos:
Documentation:
Learn REST: A RESTful Tutorial
This week we are going to write an Express application with request body in JSON format.
There are 4 CRUD actions:
Creates a new to-do
Reads and lists all to-dos
Updates the description of a to-do with ID :id
Deletes a to-do with ID :id
When calling the create
or update
actions, the request body must look like
this:
{
"todo": {
"description": "(todo description)"
}
}
Note that for these actions, the client must add the following header:
Content-Type
:application/json
In Postman, make sure to add this header, and set the Body type to raw and JSON (application/json).
For IDs, this application uses UUIDs - Universally Unique IDs. They can be generated using the uuid/v4 package, and are guaranteed never to be the same.
Check README.md in homework
subdirectory.
Check out the databases repository and find out how you can prepare for the first database lecture, Jason and Rob have provided a nice Lynda playlist so we can have a flying kick off.