You must create a node app which provides a back-end JSON Web API for a "To-Do List".
It will run on Glitch.
Here's a screenshot of a front-end for a To-Do List app.
Note: You will NOT create a front-end today, only a back-end! However, this shows the kind of data you will work with.
- Make sure you're logged in to https://glitch.com
- Remix https://glitch.com/~cyf-todolist-start
- Name your new server as
yourname-todolist
Each To-Do item is an object with the following properties:
Name | Type | Example |
---|---|---|
id |
number | 17 |
description |
string | "Buy stamps" |
completed |
boolean | false |
However:
- The
id
property must be initialised to a unique id by the server when the object is created - The
completed
property must be initialised to false by the server when the object is created
An example of a completed To-Do item:
{
"id": 10,
"description": "Do React homework",
"completed": true
}
The following actions must be available on your API
- Read all of the To-Do items
- Read ONE To-Do item, by ID.
- Delete a To-Do item, by ID, to remove it completely from your list.
- Create a new To-Do item
- The
id
property must be assigned by the server to a unique id when the object is created - The
completed
property must be initialised to false by the server when the object is created
- The
- Update a To-Do item, allowing
description
string orcompleted
status to be changed.
In all cases:
- Use
todos
as the name of the resource in all of your routes. For example, one route might beGET /todos/17
- Use JSON objects to pass To-Do items. (See "Data Model", above).
- Return suitable status codes when user input is missing, unsuitable, or matching item(s) cannot be found.
To store your data, use the todos
global array which has already been created for you in the code.
From your Glitch project, follow these steps:
- Click: Share
- Click: Project Page
- Click: Copy
- Visit this google form: https://forms.gle/J6QckcybT9pF4c158
- Paste the project page URL
- Submit the form