-
Notifications
You must be signed in to change notification settings - Fork 2
Home
POST
request to /sign-up
sending on the body
{
email: "...",
name: "...",
password: "..."
}
POST
request to /login
sending on the body
{
email: "...",
password: "..."
}
The server will respond with the object
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiaWF0IjoxNjIxMjg0NzExfQ.b8e3bYm7TnU5p6pfrCPPbzboax6gvh_gGNFR4T51FxY",
"name": "Joe"
}
DELETE
request to /logout
sending a header Authorization
with the Bearer TOKEN
format
GET
request to /records
sending a header Authorization
with the Bearer TOKEN
format
The server will respond with the object
[
{
id: new ObjectId("61ff487352dd6f68254b93a7"),
amount: "2000",
description: "Salary",
type: "income",
date: "06/02",
userId: "61ff484952dd6f68254b93a2"
},
{
id: new ObjectId("620e828737614311da58f243"),
amount: "300",
description: "Groceries",
type: "expense",
date: "07/02",
userId: "61ff484952dd6f68254b93a2"
}
]
POST
request to /records
sending on the body
{
"amount": "2000",
"description": "Salary",
"type": "income"
}
and a header Authorization
with the Bearer TOKEN
format
DELETE
request to /records/RECORD_ID
sending a header Authorization
with the Bearer TOKEN
format and replacing RECORD_ID
with the id of the record that will be deleted
PUT
request to /records/RECORD_ID
sending a header Authorization
with the Bearer TOKEN
format and replacing RECORD_ID
with the id of the record that will be updated## #