How it works...
Express provides default HTTP methods that we can listen to for specific routes. When implementing a full REST API, we want to start thinking about our API endpoints as resources that we perform operations upon using specific HTTP methods. The most common operations are to create, read, update, and delete (CRUD) resources. These operations are associated with the POST, GET, PUT, and DELETE HTTP methods in a RESTful API. Besides the HTTP method, there is also a significance in whether the resource is specifically identified or generic. For instance, GET /api/posts will return all blog posts, whereas GET /api/posts/123 will only return a blog post with the ID 123.
The following is a table that lists all the routes in our application, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access