Last active
September 21, 2015 22:45
-
-
Save noahcoad/81e413f6622e142d1606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 there world!"'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment