|
2 | 2 |
|
3 | 3 | ### Assignment |
4 | 4 |
|
5 | | -- Read through the code from the lecture, make sure you understand the flow of |
6 | | - the program |
7 | | -- Add three more actions |
8 | | - - `clear` (`DELETE /todos`) which will clear the list of todos |
9 | | - - `markAsDone` (`POST /todos/:id/done`) which will set the `done` flag of a single todo to `true` |
10 | | - - `markAsNotDone` (`DELETE /todos/:id/done`) which will set the `done` flag of a single todo to `false` |
11 | | -- Update your README to reflect your new actions! |
12 | | - |
13 | | -Take care of the following: |
14 | | - |
15 | | -- All requests that need a body should be in JSON, and follow the request structure of the other actions |
16 | | -- All responses should be in JSON, and follow the response structure of the other actions |
| 5 | +Read through the code from the lecture, make sure you understand the flow of the |
| 6 | +program. |
| 7 | + |
| 8 | +Add three more actions and update your `README.md` to reflect your new actions. |
| 9 | + |
| 10 | +### `clear` (`DELETE /todos`) |
| 11 | + |
| 12 | +Clears the list of to-dos |
| 13 | + |
| 14 | +### `markAsDone` (`POST /todos/:id/done`) |
| 15 | + |
| 16 | +Sets the `done` flag of a single to-do to `true` |
| 17 | + |
| 18 | +### `markAsNotDone` (`DELETE /todos/:id/done`) |
| 19 | + |
| 20 | +Sets the `done` flag of a single to-do to `false` |
| 21 | + |
| 22 | +## Requirements |
| 23 | + |
| 24 | +- All requests that need a body should be in JSON format, and follow the request |
| 25 | + structure of the other actions |
| 26 | +- All responses should be in JSON format, and follow the response structure of |
| 27 | + the other actions |
17 | 28 | - Follow the anatomy of the project |
18 | | -- Make your code DRY (see https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) |
19 | | -- Follow the REST design principles: use the proper method, response status codes, and consistent URL paths |
| 29 | +- Make sure your code is [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) |
| 30 | +- Follow the REST design principles: use the proper method, response status |
| 31 | + codes, and consistent URL paths |
20 | 32 | - Test your API using Postman |
0 commit comments