luckbuy
LuckBuy Home Assignment
How to run
- Install postgres database
- Run
go run main.go
to run API server
Example
1) Signup API
curl --location --request POST 'http://localhost:8080/api/v1/signup' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "nithiya123",
"refferral_code": "[email protected]"
}'
2) Login
curl --location --request POST 'http://localhost:8080/api/v1/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "gopi123"
}'
3) MyPoints
curl --location --request GET 'http://localhost:8080/api/v1/points' \
--header 'session_id: Z29waUBnbWFpbC5jb20xNjQ0ODQ5OTE3'
4) Leaderboard
curl --location --request GET 'http://localhost:8080/api/v1/leaderboard' \
--header 'session_id: Z29waUBnbWFpbC5jb20xNjQ0ODQ5NjE5'
5) Logout
curl --location --request GET 'http://localhost:8080/api/v1/logout' \
--header 'session_id: Z29waUBnbWFpbC5jb20xNjQ0ODQ5NjE5'