Skip to content

Instantly share code, notes, and snippets.

@Marak
Last active December 26, 2015 20:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marak/ef29693c66bf7e1b7454 to your computer and use it in GitHub Desktop.
Save Marak/ef29693c66bf7e1b7454 to your computer and use it in GitHub Desktop.
hook.io example microservice for sending outgoing http requests
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