- Get all todos
- Save new todo
- REST = Representational State Transfer, between request and response.
- RESTful API = Conform with REST API convention
Good example:
Endpoint | HTTP | Description |
---|---|---|
/todos |
GET |
Get all todo list |
/todos/:id |
GET |
Get one todo |
/todos |
POST |
Save new todo |
/todos |
DELETE |
Remove all todo list |
/todos/:id |
DELETE |
Remove one todo |
/todos/:id |
PUT |
Update one todo |
/todos?search |
GET |
Search todo |
Bad example:
Endpoint | HTTP | Description |
---|---|---|
/todos/display |
GET |
Get all todo list |
/todos/display/:id |
GET |
Get one todo |
/todos/save |
GET |
Save new todo |
/todos/delete |
GET |
Delete all todo |
npm install
npm run dev
npm run start