This is a Node npm project.
Uses Express minimalist web framework for Node.js.
To install dependencies:
npm install
The project uses Jest and SuperTest for testing.
To run the tests:
npm test
To start the application:
npm start
The application is published on docker hub. Run it:
podman run -p8002:8002 "codecop/rogue-stats"
Basic element of stats is HP in range 0 to 10:
get localhost:8002/stats/hp
returns JSON body with
{ "hp": 10, "alive": true }
To update the HP:
post to localhost:8002/stats/hp?action=reset
post to localhost:8002/stats/hp?action=hit
post to localhost:8002/stats/hp?action=heal
to reset, decrease of increase the HP during a game.
There are dynamic stats, e.g. gold, XP, level counter, AC, etc.
post to localhost:8002/stats/level?action=inc
post to localhost:8002/stats/level?action=dec
and it is available to query
get localhost:8002/stats/level
with JSON body
{ "level": 1 }
To remove (reset to zero) the dynamic counter again:
delete localhost:8002/stats/level
Content type
Image
Digest
sha256:2a4d5fe7d…
Size
83.2 MB
Last updated
25 days ago
docker pull codecop/rogue-stats