Skip to content
This repository was archived by the owner on Jan 3, 2026. It is now read-only.

Latest commit

 

History

History
50 lines (39 loc) · 1.35 KB

File metadata and controls

50 lines (39 loc) · 1.35 KB

Backend Exercises

In real world, we use databases to store our data, but for this exercise we will use a simple array to store our todos.

var todosArray = []

Task 1

Implement the GET /todos endpoint, that sends all the todos to the client

Hint Read about JSON

Task 2

Implement the POST /todos endpoint, that adds a new todo to the array. This receives the todo in the request body, and adds it to the array. The body looks like:

{
    todo: "Eat Food"
}
Hint Read about how to get data from the request body

Task 3

Implement the DELETE /todos/:id endpoint, that deletes a todo from the array.

Task 4

Implement the PATCH /todos/:id endpoint, that updates a todo from the array. This receives the updated todo in the request body, and updates it in the array. The body looks like:

{
    todo: "Stop eating junk food"
}

Useful resources