Skip to content

Instantly share code, notes, and snippets.

@desmondmorris
Created September 1, 2015 23:04
Show Gist options
  • Save desmondmorris/f2a3d8a1987cd87c5e70 to your computer and use it in GitHub Desktop.
Save desmondmorris/f2a3d8a1987cd87c5e70 to your computer and use it in GitHub Desktop.
My first hook.io microservice
module['exports'] = function simpleHttpRequest (hook) {
// npm modules available, see: http://hook.io/modules
var request = require('request');
request.get('http://httpbin.org/ip', function(err, res, body){
if (err) {
return hook.res.end(err.messsage);
}
hook.res.end(body);
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment