-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(health-check): Add health check from healthchecks.io (#59)
* feat(health-check): Add health check from healthchecks.io * lint
- Loading branch information
1 parent
6407337
commit a4e4f70
Showing
6 changed files
with
87 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"healthCheck": { | ||
"enabled": true, | ||
"endpoint": "https://hc-ping.com/638b7695-9ac0-4ead-a756-e8bc331a2c19", | ||
"schedule": "0 0 * * *" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import axios from 'axios' | ||
import _debug from 'debug' | ||
var debug = _debug('utils/health-check') | ||
|
||
const healthCheck = async (endpoint) => { | ||
try { | ||
debug('Performing health check...') | ||
const response = await axios.get(endpoint) | ||
debug('Health Check Result:', response.status, response.data) | ||
} catch (err) { | ||
debug('Error performing health check', err) | ||
} | ||
} | ||
|
||
export default healthCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters