Web application for managing troops, heroes and hero roles.
mvn clean install
change current directory to catacombs-chimeras-app and run:
mvn spring-boot:run
application will start booting and after you see message like this:
started Application in 20.119 seconds (JVM running for 29.462)
there should be ready web interface on localhost:8080/pa165
There are two users with roles USER and ADMIN
| ROLE | LOGIN | PASSWORD |
|---|---|---|
| USER | user | user |
| ADMIN | admin | admin |
after running the spring-boot app there should be available REST API for manipulating heroes
REQUEST METHOD: GET
REQUEST URI: /pa165/rest/heroes
REQUEST BODY: NONE
RESPONSE BODY: LIST OF HEROES
REQUEST METHOD: GET
REQUEST URI: /pa165/rest/heroes/{id}
REQUEST BODY: NONE
RESPONSE BODY: HERO ENTITY
REQUEST METHOD: POST
REQUEST URI: /pa165/rest/heroes
REQUEST BODY: HERO ENTITY (example {"name":"petr","experience":80})
RESPONSE BODY: HERO ENTITY
request:
curl -H "Content-Type: application/json" -X POST localhost:8080/pa165/rest/heroes --data '{"name":"adolf","experience":80}'
response example:
{"id":7,"name":"adolf","experience":80,"troopId":null}
request:
curl -X GET localhost:8080/pa165/rest/heroes/7
response example:
{"id":7,"name":"adolf","experience":80,"troopId":null}
request:
curl -X GET localhost:8080/pa165/rest/heroes
response example:
[{"id":1,"name":"Superman","experience":1000,"troopId":1},{"id":2,"name":"Batman","experience":120,"troopId":1}]
request:
curl -X DELETE localhost:8080/pa165/rest/heroes/7
more info about this project can be found on this project's wiki: https://github.com/Grez/Catacombs-Chimeras/wiki