-
-
Save magicaltrevor/e9ddbeb735059dc2ad87 to your computer and use it in GitHub Desktop.
Checks to see if a website is down
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
var http = require('http'); | |
var urlparams = '/api/hermes_msoe_prod/systems/listSystemItems/{"system":"curriculog","id":"18","itemType":"core","template":"True"}'; | |
module['exports'] = function isTheWebSiteDown (hook) { | |
http.get(hook.params.url + urlparams, function(res){ | |
hook.debug(hook.params.url + urlparams + " is up and running.") | |
hook.res.end(hook.res.read()); | |
}).on('error', function (){ | |
hook.debug(hook.params.url + urlparams + " is DOWN!") | |
hook.res.end('true'); | |
}); | |
}; | |
module['exports'].schema = { | |
"params": { | |
"type": "string", | |
"default": '{"system":"curriculog","id":"18","itemType":"core","template":"True"}' | |
}, | |
"url": { | |
"type": "string", | |
"default": "hermes.digarc.com" | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment