https://github.com/tarektouati/users-service
A simple Users Service made in Haskell
https://github.com/tarektouati/users-service
Last synced: 3 months ago
JSON representation
A simple Users Service made in Haskell
- Host: GitHub
- URL: https://github.com/tarektouati/users-service
- Owner: Tarektouati
- License: bsd-3-clause
- Created: 2019-05-30T16:11:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-30T16:22:14.000Z (over 5 years ago)
- Last Synced: 2025-02-08T12:47:01.473Z (4 months ago)
- Language: Haskell
- Size: 16.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# Users Service
A simple Users Service made in Haskell.
## API :
#### Sign in
POST /login
```bash
curl -X POST \
http://localhost:4001/login \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"password": "password"
}'
```#### Sign up
POST /register
```bash
curl -X POST \
http://localhost:4001/register \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"firstName": "user",
"lastName": "user",
"password" : "password"
}'
```#### Get user informations
GET /user
```bash
curl -X GET \
http://localhost:4001/user \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyQHRlc3QuY29tIiwiZXhwIjo4NjQwMCwibGFzdE5hbWUiOiJ0ZXN0MiIsImlzcyI6ImF1dGhzZXJ2aWNlIiwiZmlyc3ROYW1lIjoidGVzdDEiLCJpZCI6IjQzYTAyZWVjLTJmMWEtNDU4Zi05M2I2LWIyNzcxM2NlNDQ0ZSJ9.S7QzGxqkX4Z9NyqhQLrvOmhNPm1GTJUHS_ADYNMFXIw'
```## Configuration
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 |