Tarektouati / users-service

A simple Users Service made in Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Users Service

A simple Users Service made in Haskell.

API :

Sign in

POST /login

curl -X POST \
  http://localhost:4001/login \
  -H 'Content-Type: application/json' \
  -d '{
	"email": "email@email.com",
	"password": "password"
}'

Sign up

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 informations

GET /user

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

About

A simple Users Service made in Haskell

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 97.7%Language:TSQL 2.3%