- create github account/heroku account
- add my SSH Key to github
- set git info like:
git config -global user.name "..."
git config -global user.email "...@..."
- install heroku related commands as:
- (rvm installed)
rvm install 1.9.3
rvm use 1.9.3
gem install heroku vulcan aws-s3
- setup heroku env as:
heroku login
heroku keys:add
- create ".gitignore" as:
node_modules
- create "web.js" as:
require("http").createServer(function (req, res) {
res.writeHead(200, {"content-type": "text/plain;charset=UTF-8"});
res.end("Hello World\n");
}).listen(process.env.PORT || 8000);
- create "Procfile" as:
web: node web.js
- create "package.json" like:
{"name": "fb-bb-helloworld",
"version": "0.0.1"}
- create new repository as:
git init
git add .
git commit -a -m "[init]"
create nodejs 0.6.10 stack with the public buildpack on github
- run commands on my repository dir like:
- "fb-bb-helloworld": a name of new app on heroku
- http://github.com/hakobera/heroku-buildpack-nodejs.git : public buildpack for node.js-0.6.10
heroku create fb-bb-helloworld --stack cedar \
--buildpack http://github.com/hakobera/heroku-buildpack-nodejs.git
- upload to heroku as:
git push heroku master
- check app to access: http://fb-bb-helloworld.herokuapp.com/
- befor using addons, you should register your "credit card number" to your heroku account
- add price free SSL addon "piggyback_ssl" from web or the command as:
heroku addons:add piggyback_ssl
- then you can access as: https://fb-bb-helloworld.herokuapp.com/
- (not need to implement a ssl server on the js code)
- for more detail, see: gist-1815094
- set the secure tab page as: https://fb-bb-helloworld.herokuapp.com/
- access the facebook app: https://apps.facebook.com/bb-helloworld/
For the tutorial:
- Getting Started with Node.js on Heroku/Cedar
- Heroku article for SSL addons
- Running Your Own Node.js Version on Heroku
- Side by the public buildpack author (JPN)
For the preparation: