decode final project (Denis, Konrad, Jonathan)
Server port: 5050
express, MongoClient, MongoDB by mLab,
Session id generator to a digit from 10mln to 99,999mln
Name: __sid__
Value: 77003076
Expired: never
url: http://localhost:5050/tests method: get body: none
response:
{
"success": true,
"tests": [
{
"_id": "5c5f76a8bfc646349070c2d4",
"name": "Forrest",
"surname": "Gump"
},
{
"_id": "5c66f9311621e129c25ccbfa",
"name": "Buzz",
"surname": "Lightyear"
}
]
}
url: http://localhost:5050/tests/add method: post body:
{
"name": "Buzz",
"surname": "Lightyear"
}
response:
{
"success": true,
"message": "test added",
"doc": {
"n": 1,
"opTime": {
"ts": "6658289882600833025",
"t": 1
},
"electionId": "7fffffff0000000000000001",
"ok": 1,
"operationTime": "6658289882600833025",
"$clusterTime": {
"clusterTime": "6658289882600833025",
"signature": {
"hash": "lz4i5xB7ArylNevlRM0zqArcs8s=",
"keyId": "6656070557034872833"
}
}
}
}
url: http://localhost:5050/users method: get body: none
response:
{
"success": true,
"users": [
{
"_id": "5c670254552be03f4005fcd2",
"email": "[email protected]",
"password": "123"
}
]
}
url: http://localhost:5050/users/signup method: post body:
{
"email": "[email protected]",
"password": "123"
}
response:
Cookie: sid:
{
"success": true,
"message": "user added",
"doc": {
"n": 1,
"opTime": {
"ts": "6658320518602555393",
"t": 1
},
"electionId": "7fffffff0000000000000001",
"ok": 1,
"operationTime": "6658320518602555393",
"$clusterTime": {
"clusterTime": "6658320518602555393",
"signature": {
"hash": "1nTYbjTK4zksxBzm/UmoeO9wlEs=",
"keyId": "6656070557034872833"
}
}
}
}
url: http://localhost:5050/users/login method: post body:
{
"email": "[email protected]",
"password": "123"
}
response:
Cookie: sid:
{
"success": true,
"message": "Logged in successfully"
}
Dev Client port: 3080