API para aplicato mobile credigame
yarn || npm install
yarn dev || npm dev
POST /users/register/
curl -i -H 'Accept: application/json' http://localhost:3333/users/register/
`Body: { name: string; lastName: string; email: string; password: string; }
`
HTTP/1.1 200 OK
Date: Thu, 24 Feb 2011 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 2
[]
POST /users/auth/
curl -i -H 'Accept: application/json' -d 'email=string&password=string' http://localhost:3333/users/auth
`Body: { email: string; password: string; }
`
HTTP/1.1 201 Created
Date: Thu, 24 Feb 2011 12:36:30 GMT
Status: 201 Created
Connection: close
Content-Type: application/json
Location: /thing/1
Content-Length: 36
{"success": true, "user": { "name": string }, "token": string}
POST /users/update-score
curl -i -H 'Accept: application/json' -d 'score=10' http://localhost:3333/users/update-score
`Should be Authenticaded with Bearer Token on Header, generated on /users/auth`
Body: { score: number }
HTTP/1.1 200 OK
Date: Thu, 24 Feb 2011 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 36
{"success": true, "message": "User score successfuly updated"}
POST /users/ranking
curl -i -H 'Accept: application/json' -d 'score=10' http://localhost:7000/users/update-score
`Should be Authenticaded with Bearer Token on Header, generated on /users/auth`
HTTP/1.1 200 OK
Date: Thu, 24 Feb 2011 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 36
{"success": true,"data": [{"name": string,"lastName": string,"score": number},{"name": string,"lastName": string,"score": number}]