Skip to content

Commit dfd6342

Browse files
committed
Merge branch 'master' of github.com:mrspartak/js-internet-status-api
2 parents bf0af5a + 2496569 commit dfd6342

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

README.md

+22-4
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,42 @@ Return JSON with current status and disconnects history
77

88
[![Latest Github tag](https://img.shields.io/github/v/tag/mrspartak/js-internet-status-api?sort=date&style=for-the-badge "Latest Github tag")](https://github.com/mrspartak/js-internet-status-api/releases "Latest Github tag")
99

10+
## Docker run
11+
Run with defaults
12+
```
13+
docker run -p 3010:3010 --name internet-check \
14+
-v internet-check:/home/node/app/data \
15+
assorium/js-internet-status-api:latest
16+
```
17+
Or use environment variables
18+
```
19+
docker run -p 3010:3010 --name internet-check \
20+
-v internet-check:/home/node/app/data \
21+
-e CHECK_WEBSITE=https://example.com -e RELEVANCE_TIMEOUT=1 \
22+
assorium/js-internet-status-api:latest
23+
```
1024

1125
## Environment variables
1226

1327
#port app will be launched at
1428
const PORT = process.env.PORT || 3010
29+
1530
#interval to check connection in seconds
1631
const INTERVAL = +process.env.INTERVAL * 1000 || 10000;
32+
1733
#website to check connection
1834
const CHECK_WEBSITE = process.env.CHECK_WEBSITE || 'https://google.com';
1935
#timeout in seconds
2036
const CHECK_TIMEOUT = +process.env.CHECK_TIMEOUT * 1000 || 5000;
2137
#retries
2238
const CHECK_RETRIES = +process.env.CHECK_RETRIES || 2;
39+
2340
#this time in hours data will be stored
2441
const RELEVANCE_TIMEOUT = +process.env.RELEVANCE_TIMEOUT * 60 * 60 || 24 * 60 * 60;
2542

2643
## API
2744

28-
#just GET / request
29-
30-
#sample response
45+
JSON API | GET /
3146
```
3247
{
3348
success: true,
@@ -42,4 +57,7 @@ Return JSON with current status and disconnects history
4257
}
4358
]
4459
}
45-
```
60+
```
61+
62+
Graphs | GET /graph.html
63+
![image](https://user-images.githubusercontent.com/993910/74189670-e6722380-4c61-11ea-9b8e-c8860138f95c.png)

0 commit comments

Comments
 (0)