Operation | HTTP Method | URL | URL params | Request body | Example |
---|---|---|---|---|---|
Create | POST | /api/posts/add | body: {...} | POST /api/posts/add body: {...} | |
Read One | GET | /api/posts/:id | :id (item id) | GET /api/posts/123 | |
Read All | GET | /api/posts | GET /api/posts | ||
Update | PUT | /api/posts/update/:id | :id (item id) | body: {...} | PUT /api/posts/update/123 body:{...} |
Delete | DELETE | /api/posts/delete/:id | :id (item id) | DELETE /api/posts/delete/123 |
To perform CRUD Operations locally, Refer above
table
Go to http://localhost:3000/api/posts
to get
all data (in JSON).