|
2 years ago | |
---|---|---|
app | 2 years ago | |
flyway | 2 years ago | |
nix | 2 years ago | |
src | 2 years ago | |
test | 2 years ago | |
.gitignore | 2 years ago | |
CHANGELOG.md | 2 years ago | |
Dockerfile | 2 years ago | |
LICENSE | 2 years ago | |
Makefile | 2 years ago | |
README.md | 2 years ago | |
Setup.hs | 2 years ago | |
default.nix | 2 years ago | |
docker-compose.yml | 2 years ago | |
servant-example.cabal | 2 years ago | |
shell.nix | 2 years ago |
docker-compose up
nix-shell --pure
make build
make run
curl -X POST -H "Content-Type: application/json" \
-d '{"email":"customer@email.com","password":"123password"}' \
http://localhost:8080/api/customer/registerCustomer
# This endpoint will respond with an id {"id":"1376fbef-6832-4de0-9839-49f615e0c6d1"}
curl -X POST -H "Content-Type: application/json" \
-d '{"email":"customer@email.com","password":"123password"}' \
http://localhost:8080/login
# This endpoint will respond with this json body
# {"token": <JWT Token>
# ,"firstName":null
# ,"lasttName":null
# ,"email":"customer@email.com"
# }
The JWT received from /login
is needed to interact with the protected
endpoint. For example
curl -X GET -H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
http://localhost:8080/api/customer/getCustomerByEmail/customer@email.com