Skip to content

chebro/heartbeat-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heartbeat.js

A webpage that displays the most recent heartbeat (ping) received by the server (from a client).

├─ src     - express.js web app
└─ scripts - systemd timer modules for clients

Install heartbeat.js:

git clone https://github.com/chebro/heartbeat.js
cd heartbeat.js && npm ci

Run (local)

# create and export auth token
AUTH='some secure token'; echo -e "AUTH=$AUTH" > .env

# start server
HOST=localhost PORT=8080 npm start

# send heartbeat
curl -X POST -H "Auth: $AUTH" localhost:8080

Run (production)

TODO

Environment variables

All env vars are stored in .env, the following is an example:

AUTH='some secure token'
HOST=localhost
PORT=8080