|
|
2 ani în urmă | |
|---|---|---|
| Docker | 2 ani în urmă | |
| gradle | 2 ani în urmă | |
| src | 2 ani în urmă | |
| .gitignore | 2 ani în urmă | |
| README.md | 2 ani în urmă | |
| build.gradle.kts | 2 ani în urmă | |
| gradle.properties | 2 ani în urmă | |
| gradlew | 2 ani în urmă | |
| gradlew.bat | 2 ani în urmă | |
| settings.gradle.kts | 2 ani în urmă |
gradle build
unzip build/distributions/playerRank-0.0.1.zip -d <location>
/<location>/playerRank-0.0.1/bin/playerRank
starts web server with api: http://localhost:8080/
gradle test --tests "re.chasam.models.impl.TournamentImplTest"
gradle test --tests "re.chasam.models.impl.PlayerTest"
Its access follows the format:
scheme://host:port
to access to a db and use collection. Defaults parameters can be overriden using environments variables:
SCHEME
HOST
PORT
NAME
COLLECTION
cd Docker
docker compose up
lists all players with name score and rank
get a player score and its rank
add a new player, its score and rank are set to 0
set the score of a player
remove all players
curl -X POST -d '{"name":"Player 1","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
curl -X POST -d '{"name":"Player 2","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
curl -X POST -d '{"name":"Player 3","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
curl -X POST -d '{"name":"Player 4","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
curl -X PATCH -d '{"score":42}' -H "Content-Type: application/json" "http://127.0.0.1:8080/players/Player%201"
curl -X GET "http://127.0.0.1:8080/players/Player%201"
curl -X GET "http://127.0.0.1:8080/players/Player%202"
curl -X DELETE -H "Content-Type: application/json" http://127.0.0.1:8080/players