Local Link
http://localhost:3000/login
URI | HTTP Method | Authentication | Headers |
---|---|---|---|
login |
POST | None | None |
Parameter | Type | Description | Required? |
---|---|---|---|
String | Email Adress of User. | Yes | |
password | String | User's Password. | Yes |
Example Request Code:
let loginOptions = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(form),
};
fetch("http://localhost:3000/login", loginOptions);
Example Response:
{
"_id": "62e4099919855406aacf9009",
"name": "Mustafa",
"email": "mustafa@binalhag.dev",
"hobbies": [
"Playing games Ark/Valorant/Apex",
"Lifting big cirlces",
"Watching Anime"
],
"__v": 0
}
Local Link
http://localhost:3000/register
URI | HTTP Method | Authentication | Headers |
---|---|---|---|
register |
POST | N/A | N/A |
Parameter | Type | Description | Default | Required? |
---|---|---|---|---|
name | String | Name for User | N/A | Yes |
password | String | User's Password | N/A | Yes |
String | User's Email | N/A | Yes | |
hobbies | [String] | Array of hobbies Name | N/A | No |
Example Request Code:
let registerOptions = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(form),
};
fetch("http://localhost:3000/register", registerOptions);
Example Response:
{
"_id": "62e4099919855406aacf9009",
"name": "Mustafa",
"email": "mustafa@binalhag.dev",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYyZTQwOTk5MTk4NTU0MDZhYWNmOTAwOSIsImlhdCI6MTY1OTExMTgzNCwiZXhwIjoxNjYwMzIxNDM0fQ.Obtnn5918MCxQT_ZPaKGz1KXtSJIKsI1KGn7boayPu4"
}