This is a example about Node.js.
In this demo, I designed it with the MVC pattern, and I used some middleware such as Express, Mongoose and Body-Parser. In addition, I used mLab Sandbox database to test.
Moreover, the example will show the CURD operations with RESTful principle.
-
- Type: GET
- Url: /product/test
-
- Type: POST
- Url: /product/create
-
- Type: GET
- Url: /product/list
-
- Type: GET
- Url: /product/detail/:id
-
- Type: PUT
- Url: /product/detail/:id/update
-
- Type: DELETE
- Url: /product/detail/:id/delete