- Run:
docker build -t leaderboards .
- Run:
docker-compose up
Swagger: http://localhost:8080/swagger-ui/index.html
Request:
curl --location --request GET 'http://localhost:8080/v1/scores/all-time'
Response:
[
{
"id": 5,
"name": "Olivia",
"value": 452
},
{
"id": 7,
"name": "Sophia",
"value": 231
},
{
"id": 4,
"name": "Ethan",
"value": 155
},
...
]
Request:
curl -X 'GET' \ 'http://localhost:8080/v1/scores/monthly?month=JANUARY' \ -H 'accept: application/json'
Response:
[
{
"id": 5,
"name": "Olivia",
"value": 452
},
{
"id": 7,
"name": "Sophia",
"value": 231
},
{
"id": 4,
"name": "Ethan",
"value": 155
},
...
]
Request:
curl --location --request POST 'http://localhost:8080/v1/scores' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "Thiago", "value": 35 }'
Response:
{
"id": 16,
"name": "Thiago",
"value": 35,
"createDate": "2023-03-28T19:57:57.8777634"
}