Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stateful Counter

Welcome to Stateful Counter - a simple toy app designed for the workshop: "Docker Demystified".

The application simply keeps a record of how long it has been running, by consistently calculating the elapsed time from an initial starting value, initialised when the app is started.

You can pass environment variables when starting the server, to affect the background colour of the app, and give the instance a label. This will be useful later when create multiple instances in Docker containers.

Screenshots

Screenshot of the 'stateful-counter' application, showing time elapsed since start.

Instructions for Use

Assuming that you have cloned this repo and have a working installation of NodeJS, you can set up & run the app locally with the following commands:

# inside the 'stateful-counter' directory:

npm install # installs the app's dependencies

npm start # accesses the 'start' script in the file 'package.json'

# optional:
node server.js # this command is all that 'npm start' is doing.

If you would like to try running the app with the environment variables, you can do the following:

CONTAINER_LABEL="My Container" CONTAINER_COLOUR="hotpink" node server.js

To stop the server, simply use Ctrl-C on Windows or ⌘ Command + C on Mac OS.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages