I made this API for my Todo App to handle user registration, authentication, CRUD operations of todo items and saving data in MongoDB.
API should handle the following:
- Create a new user and save user data in the database
- User Sign in Process & sending authentication token
- User Sign out Process & deleting authentication token
- Create a new todo for a user and save it in the database
- Get all todo items of the user
- Delete a todo item from the database
[POST] "http://localhost:4000/sign_up"
Method |
POST |
Body |
{"name": "Hatem" , "email": "hatem@gmail.com" , "password": "123456"} |
[POST] "http://localhost:4000/sign_in"
[GET] "http://localhost:4000/sign_out"
Get a user information (name and email)
[GET] "http://localhost:4000/user"
Get all todo items of a user
[GET] "http://localhost:4000/1"
Method |
GET |
Parameters |
User Id |
[POST] "http://localhost:4000/1"
Method |
POST |
Parameters |
User Id |
Body |
{"content": "learn a new language"} |
[DELETE] "http://localhost:4000/1/2"
Method |
DELETE |
Parameters |
User Id, Todo Id |