Created
May 8, 2014 05:49
-
-
Save bcoe/1b375b025c02f0cd905e to your computer and use it in GitHub Desktop.
restify-hello-world.js
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
var restify = require('restify'), // require the restify library. | |
server = restify.createServer(); // create an HTTP server. | |
// add a route that listens on http://localhost:5000/hello/world | |
server.get('/hello', function (req, res, cb) { | |
res.send("Hello World!"); | |
return cb(); | |
}); | |
server.listen(process.env.PORT || 5000, function () { // bind server to port 5000. | |
console.log('%s listening at %s', server.name, server.url); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment