- Part 1: Request and Response
- Part 2: HTTP Request Methods
- Part 3: Dynamic Routing
- Part 4: RESTful Design
Express is a popular minimalist web framework for Node.js.
|CRUD||HTTP Request Method|
Creating a RESTful design is based on determining core objects and their relationships. For a project based on organizing books, for example, a URI component might be “/book/:id” to return a single resource or “/genre/:topic” to return a collection of books based on their genre.
Resource manipulation through representations
Designs following the RESTful style should allows all valid CRUD operations for existing resources via the representation provided. In other words, having a representation, a URI scheme, should allow all valid operations within the permission context.
The use of the words “permission context” are important because it could be the case that clients have limited or varying permissions. Not all clients may be allowed to delete or change recourses, for example.
An important consideration when using RESTful design is to also include “self-descriptive messages” for all end-routes. Any parameter passed to a URL should return some form of feedback, even if only an error message.