An example of deploying a Restify app to Heroku. It can be used to deploy a web service (REST API).
Created
May 13, 2013 10:54
-
-
Save gisthero/5567531 to your computer and use it in GitHub Desktop.
Restify on Heroku
This file contains hidden or 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
{ | |
"name": "restify-example", | |
"version": "0.0.1", | |
"dependencies": { | |
"restify": "2.4.x" | |
}, | |
"engines": { | |
"node": "0.10.x", | |
"npm": "1.2.x" | |
} | |
} |
This file contains hidden or 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
web: node rest.js |
This file contains hidden or 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"); | |
var server = restify.createServer(); | |
function respond(req, res, next) { | |
res.send('Hello World!'); | |
} | |
server.get('/', respond); | |
var port = process.env.PORT || 5000; | |
server.listen(port, function() { | |
console.log("Listening on " + port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment