Skip to content

hamza-hajji/todos_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TODO API With MongoDB and Express

Register a new user

POST /users Pass a json object like this:

{
  "email": "[email protected]",
  "password": "123"
}

You get JSON Web Token that you pass to all requests via the header x-auth.

Add new TODO

url: POST /todos

body:

{
  "text": "Do something",
  "completed": false, // default
}

You get an ID that you use to edit the todo or delete it.

Get a TODO

url: GET /todos/todoID

response:

{
  "text": "Do something",
  "completed": false
}

Edit a TODO

url: PATCH /todos/todoID

body:

{
  "text": "Edited text",
  "completed": true
}

Remove a TODO

url: DELETE /todos/todoID

response:

{ // the deleted todo
  "text": "Edited text",
  "completed": true
}

Get all your TODOs

url: GET /todos

response:

{
  todos: [{
    "text": "TODO 1",
    "completed": true
  },
  {
    "text": "TODO 2",
    "completed": false
  }, ...]
}

About

Todos API implemented in ExpressJS and MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published