- Expressjs
- MongoDB
- bcryptj: to encrypt user password
- pinno: logger utility
1 - Register a new Account :
- Send a
POST
request to /auth/register
- Request Body in
JSON
is
- NOTE all Variables are of type
String
- NOTE use the same
keys
specified in the json below
{
"username": "zein",
"email": "zein@gmail.com",
"password": "12345678",
"confirmPassword": "12345678"
}
{
"err": false,
"message": "The error description if there is any",
"user": {
},
"token": "jwt token"
}
2 - Login a new Account :
- Send a
POST
request to /auth/login
{
"email": "zein@gmail.com",
"password": "12345678",
}
- Also response body will be :
{
"err": false,
"message": "The error description if there is any",
"user": {
"username": "",
},
"token": "jwt token"
}
- Send a
POST
request to /todo/new-todo
{
"title": "Todo title",
"notes": [
"Note one",
"Note two"
],
"attachement": "file"
}
- Send a
POST
request to /todo/update-todo
{
"title": "Todo title",
"notes": [
"Note one",
"Note two"
],
}
- Send a
POST
request to /todo/get-todo/:todoId
- Returns the todo with the corresbonding id or an error
- Send a
DELETE
request to /todo/delete-todo/:todoId