Skip to content

Instantly share code, notes, and snippets.

@Marak
Created July 23, 2015 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marak/df5e72cfbb238a6801d1 to your computer and use it in GitHub Desktop.
Save Marak/df5e72cfbb238a6801d1 to your computer and use it in GitHub Desktop.
My first hook.io microservice
module['exports'] = function echo (hook) {
// Access Node.js HTTP Request and Response objects
var req = hook.req,
res = hook.res;
// Use NPM Modules
var faker = require('faker');
res.write('<strong>BYE BILLY</strong> ');
res.write(req.headers["x-forwarded-for"] + '<br/>');
res.end(faker.hacker.phrase());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment