https://github.com/chebro/heartbeat-js
digital heartbeat
https://github.com/chebro/heartbeat-js
expressjs hacktoberfest
Last synced: 9 months ago
JSON representation
digital heartbeat
- Host: GitHub
- URL: https://github.com/chebro/heartbeat-js
- Owner: chebro
- License: mit
- Created: 2021-04-14T19:29:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T16:57:59.000Z (over 3 years ago)
- Last Synced: 2025-02-02T05:24:49.169Z (over 1 year ago)
- Topics: expressjs, hacktoberfest
- Language: EJS
- Homepage: https://hb.chebro.dev
- Size: 502 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
git clone https://github.com/chebro/heartbeat.js
cd heartbeat.js && npm ci
```
## Run (local)
```bash
# 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)
```bash
TODO
```
## Environment variables
All env vars are stored in `.env`, the following is an example:
```bash
AUTH='some secure token'
HOST=localhost
PORT=8080
```