Last active
August 20, 2018 17:10
-
-
Save joemccann/626fb65255804e5fc8e50e295aa1fdf2 to your computer and use it in GitHub Desktop.
Revisions
-
joemccann revised this gist
Aug 20, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,8 @@ function main() { schedule.scheduleJob('* * * * *', async () => { const urls = [ `https://XXX.now.sh/`, `https://YYY.now.sh/` ] for (let url of urls) { try { -
joemccann created this gist
Aug 20, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ const tiny = require('tiny-json-http') const schedule = require('node-schedule') const { error, log } = console function main() { schedule.scheduleJob('* * * * *', async () => { const urls = [ `https://crypto-analytics-bot-nolygdkjvt.now.sh/`, `https://api-gxijwgqiom.now.sh/_health` ] for (let url of urls) { try { const ping = await tiny.get({ url }) log(`Status: ${ping.body.status} | Timestamp: ${ping.body.timestamp}`) } catch (e) { error(e) } } }) } main()