Sign inSign up

codecop/rogue-stats

By codecop

•Updated about 2 months ago

Image
0

354

codecop/rogue-stats repository overview

⁠Rogue-Stats @ 8002

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

⁠Docker Image

The application is published on docker hub⁠. Run it:

podman run -p8002:8002 "codecop/rogue-stats"

⁠Usage

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

Tag summary

Content type

Image

Digest

sha256:2a4d5fe7d…

Size

83.2 MB

Last updated

about 2 months ago

docker pull codecop/rogue-stats