CRUD implementation using express with mongoDB
return a list of all todos
create a new todo, request should contain a JSON request body object following this schema:
{
"description": string,
"completed": boolean
}
get a specific todo by ID
delete a todo by ID
update a todo ,request should contain a JSON request body object following this schema, or at least one of the allowed fields:
{
"description": string,
"completed": boolean
}
- go to
https://www.mongodb.com/products/compass
and download mongodb compass - create a new TodoList collection
- make sure it is running on
localhost:27017
- go to project directory and run
npm install
- create some todos using
POST /todos
route calls
npm run dev