A simple Users Service made in Haskell.
POST /login
curl -X POST \
http://localhost:4001/login \
-H 'Content-Type: application/json' \
-d '{
"email": "email@email.com",
"password": "password"
}'
POST /register
curl -X POST \
http://localhost:4001/register \
-H 'Content-Type: application/json' \
-d '{
"email": "email@email.com",
"firstName": "user",
"lastName": "user",
"password" : "password"
}'
GET /user
curl -X GET \
http://localhost:4001/user \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyQHRlc3QuY29tIiwiZXhwIjo4NjQwMCwibGFzdE5hbWUiOiJ0ZXN0MiIsImlzcyI6ImF1dGhzZXJ2aWNlIiwiZmlyc3ROYW1lIjoidGVzdDEiLCJpZCI6IjQzYTAyZWVjLTJmMWEtNDU4Zi05M2I2LWIyNzcxM2NlNDQ0ZSJ9.S7QzGxqkX4Z9NyqhQLrvOmhNPm1GTJUHS_ADYNMFXIw'
There's environment variables to customise your service :
Name | Description | Default |
---|---|---|
PORT | The listening port of the service | 4001 |
AUTH_SERVICE | Auth service HTTP endpoint | http://localhost:4002 |
PG_URl | PGSQL connectionstring | postgres://dbUser:dbPassword@localhost:5432/haskell-users |