yarn install
touch .env
echo $'PORT=<ENTER_PORT_HERE>\nJWT_SECRET=<ENTER_JWT_SECRET_HERE>' > .env
yarn start
Request:
curl -i -X POST http://<ENTER_HOST_HERE>/session -d'{"username" : "admin", "password": "1234567"}' -H"content-type: application/json"
Response: HTTP 200
{
"jwt":string
}
Response: HTTP 401
Requires: Authentication (if fails HTTP 401)
Request:
curl -i http://<ENTER_HOST_HERE>/user/me
Response: HTTP 200
{
"username":string,
"nameSurname":string
}
Request:
curl -i -X POST http://<ENTER_HOST_HERE>/user -d'{"username" : "admin", "password": "1234567", "nameSurname": "Necip Allef"}' -H"content-type: application/json"
Response: HTTP 201 Response: HTTP 409
Requires: Authentication (if fails HTTP 401)
Request:
curl -i -X POST http://<ENTER_HOST_HERE>/todo -d'{"title": "title", "details": "details"}'
Response: HTTP 201
Requires: Authentication (if fails HTTP 401)
Request:
curl -i http://<ENTER_HOST_HERE>/todo
Response: HTTP 200
[{
"title":string,
"details":string
}]
Requires: Authentication (if fails HTTP 401)
Request:
curl -i -X DELETE http://<ENTER_HOST_HERE>/todo/:id
Response: HTTP 404
Response: HTTP 200