@@ -7,27 +7,42 @@ Return JSON with current status and disconnects history
7
7
8
8
[ ![ 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 ")
9
9
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
+ ```
10
24
11
25
## Environment variables
12
26
13
27
#port app will be launched at
14
28
const PORT = process.env.PORT || 3010
29
+
15
30
#interval to check connection in seconds
16
31
const INTERVAL = +process.env.INTERVAL * 1000 || 10000;
32
+
17
33
#website to check connection
18
34
const CHECK_WEBSITE = process.env.CHECK_WEBSITE || 'https://google.com';
19
35
#timeout in seconds
20
36
const CHECK_TIMEOUT = +process.env.CHECK_TIMEOUT * 1000 || 5000;
21
37
#retries
22
38
const CHECK_RETRIES = +process.env.CHECK_RETRIES || 2;
39
+
23
40
#this time in hours data will be stored
24
41
const RELEVANCE_TIMEOUT = +process.env.RELEVANCE_TIMEOUT * 60 * 60 || 24 * 60 * 60;
25
42
26
43
## API
27
44
28
- #just GET / request
29
-
30
- #sample response
45
+ JSON API | GET /
31
46
```
32
47
{
33
48
success: true,
@@ -42,4 +57,7 @@ Return JSON with current status and disconnects history
42
57
}
43
58
]
44
59
}
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