- NB: skip the database and use an array to save the todos
- Todo is an object with id: number, title: string, completed: boolean
- Data type validation
- GET / ---> List all todos
- GET /todos ---> List all todos
- GET /todos?id=1. ----> List only single todo 1 in this case is just example of id but it should work with any id stored
- POST /todos ---> create new todo
- PATCH /todos?id=1 ---> update existing todo using the id
- DELETE /todos?id=1 ---> removes existing todo using the id
- Clone repo
- Run
npm install
to install dependencies - Run
nodemon run
to start server - Open in browser
localhost:3000
or127.0.0.1:3000
- Check urls and response results in dev tools:
localhost:3000/todos
- shows all todoslocalhost:3000/todos/?id=
+ add number 1-4 to show one existing item in a todo list- use Thunder Client or Postman to check POST/PATCH/DELETE requests