Skip to content

Instantly share code, notes, and snippets.

@Marak

Marak/testHook.js

Created Sep 3, 2015
Embed
What would you like to do?
My first hook.io microservice
// A simple hello world microservice
// Click "Deploy Service" to deploy this code
// Service will respond to HTTP requests with a string
module['exports'] = function helloWorld (hook) {
// hook.req is a Node.js http.IncomingMessage
var host = hook.req.host;
// hook.res is a Node.js httpServer.ServerResponse
// Respond to the request with a simple string
hook.res.end(host + ' says, "Hello world!"');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment