An RPG game built by using gRPC services
Run the following commands from the root of the project to build and test the dice server:
mvn clean package (1)
java -jar target/dice-0.1.0.jar (2)
grpcurl -import-path src/main/proto -proto dice.proto -plaintext -d '{"ask": "Throw dice"}' localhost:8980 dice.ThrowDiceService/ThrowDice (3)
-
Build the jar with dependencies and the gRPC classes needed for the server to run
-
Run the server
-
Test the server with
grpcurl
. For more go to: https://github.com/fullstorydev/grpcurl
❗
|
The string for asking the value has to be: "Throw dice". If not, it won’t return a value. |
ℹ️
|
If you want to change the port where the gRPC service is listening. You can change the DICE_PORT constant in src/main/java/io/grpg/dice/Constants.java
|