Skip to content

Instantly share code, notes, and snippets.

@bcoe
Created May 8, 2014 05:49
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 bcoe/1b375b025c02f0cd905e to your computer and use it in GitHub Desktop.
Save bcoe/1b375b025c02f0cd905e to your computer and use it in GitHub Desktop.
restify-hello-world.js
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