https://github.com/mars/peer-health-checker
A web app that tests the health of a connection between two networks
https://github.com/mars/peer-health-checker
Last synced: 9 months ago
JSON representation
A web app that tests the health of a connection between two networks
- Host: GitHub
- URL: https://github.com/mars/peer-health-checker
- Owner: mars
- License: mit
- Created: 2018-08-28T00:36:57.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-29T00:02:41.000Z (almost 8 years ago)
- Last Synced: 2025-02-09T19:18:19.301Z (over 1 year ago)
- Language: JavaScript
- Size: 58.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Peer Health Checker
## Requires
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [Node.js](https://nodejs.org)
## Development
`git clone` this repo to your local machine, and then:
```bash
cd peer-health-checker/
npm install
```
**This app is run twice; once for each side of a peered connection.** In development, both apps will be run on the local computer.
Start up the **Health app** in the terminal:
```bash
PORT=5000 \
HEALTH_CHECKER_PEER_URL=http://localhost:5001 \
HEALTH_CHECKER_SELF_URL=http://localhost:5000 \
npm run dev
```
Then, start up the **Health Checker app** in a second terminal in the same directory:
```bash
PORT=5001 \
npm run dev
```
### Manual Docker build
✏️ *In these commands replace `$DOCKER_USERNAME` with your **docker.com** account name, and `$LOCAL_IP` with your external network address. (Discover with `ipconfig getifaddr en0`.)*
```bash
docker build -t $DOCKER_USERNAME/peer-health-checker .
docker run \
-p 8000:80 \
-e HEALTH_CHECKER_PEER_URL=http://$LOCAL_IP:8001 \
-e HEALTH_CHECKER_SELF_URL=http://$LOCAL_IP:8000 \
-d $DOCKER_USERNAME/peer-health-checker
docker run \
-p 8001:80 \
-d $DOCKER_USERNAME/peer-health-checker
```
### Manual Heroku build
```bash
npm install
npm run build
mkdir -p heroku-slug/app
cp -r !(heroku-slug) .next .profile.d heroku-slug/app/
cd heroku-slug/app
curl http://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.gz | tar xzv
cd ..
tar czfv heroku-slug.tgz ./app
```
The resulting slug archive `heroku-slug.tgz` has a **web** process of `npm start`.