https://github.com/henryssondaniel/rockpaperscissors-java
Rock paper scissors game
https://github.com/henryssondaniel/rockpaperscissors-java
rest rest-api restful-api rock-paper-scissors
Last synced: 11 months ago
JSON representation
Rock paper scissors game
- Host: GitHub
- URL: https://github.com/henryssondaniel/rockpaperscissors-java
- Owner: HenryssonDaniel
- License: mit
- Created: 2019-09-13T08:19:16.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-10T09:32:57.000Z (over 6 years ago)
- Last Synced: 2025-05-13T07:49:33.734Z (about 1 year ago)
- Topics: rest, rest-api, restful-api, rock-paper-scissors
- Language: Java
- Size: 99.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rock paper scissors game
[](https://travis-ci.com/HenryssonDaniel/rockpaperscissors-java)
[](https://sonarcloud.io/dashboard?id=HenryssonDaniel_rockpaperscissors-java)
[](https://github.com/HenryssonDaniel/rockpaperscissors-java/blob/master/doc/release-notes/official.md)
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.github.henryssondaniel%22%20AND%20a%3A%22rockpaperscissors%22)
[](https://www.javadoc.io/doc/io.github.henryssondaniel/rockpaperscissors)
## Start the application
The application requires Java 11 and Gradle.
Run the application with the command: "gradle appRun", which will start a Jetty server and deploy the application there.
## API
GET /api/games/{id}
POST /api/games
POST /api/games/{id}/join
POST /api/games/{id}/move
## Examples
### GET
http://localhost:8080/RockPaperScissors/api/games/49825edf-d5ae-4867-9406-2286a0b4e7b9
Possible output: Daniel: PAPER. Daniela: ROCK. The winner is: Daniel
### POST
http://localhost:8080/RockPaperScissors/api/games
Request body: {"name": "Daniel"}
This will return an UUID to be used for this game. Possible 49825edf-d5ae-4867-9406-2286a0b4e7b9
http://localhost:8080/RockPaperScissors/api/games/49825edf-d5ae-4867-9406-2286a0b4e7b9/join
Request body: {"name": "Daniela"}
This will return a response message, possible OK.
http://localhost:8080/RockPaperScissors/api/games/49825edf-d5ae-4867-9406-2286a0b4e7b9/move
Request body: {"move": "Paper", "name": "Daniel"}
This will return a response message, possible OK.