Skip to content

Instantly share code, notes, and snippets.

@insanity54
Created August 7, 2017 01:06
Show Gist options
  • Save insanity54/c98dc8c01752c6e7cdf04535c946cf00 to your computer and use it in GitHub Desktop.
Save insanity54/c98dc8c01752c6e7cdf04535c946cf00 to your computer and use it in GitHub Desktop.
lolguide-server
module['exports'] = function lolSummoner(hook) {
hook.res.json(hook.params);
http.get('https://na1.api.riotgames.com/lol/summoner/v3/summoners/by-name/'+hook.params.name, function(res) {
hook.debug(hook.params.name + " is the summoner name requested" + res.body);
hook.res.end(res.body);
}).on('error', function(e) {
hook.debug(e);
hook.res.end(e);
});
};
/**
module['exports'] = function isTheWebSiteDown (hook) {
http.get(hook.params.url, function(res){
hook.debug(hook.params.url + " is up and running.")
hook.res.end('false');
}).on('error', function (){
hook.debug(hook.params.url + " is DOWN!")
hook.res.end('true');
});
};
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment