To test on normal system, just run it. Should be no differences.
For heroku, get heroku setup as defined here: http://devcenter.heroku.com/articles/node-js
Copy config.json.sample to config.json
Before you deploy to heroku, config.json needs to be in the repository, so you can git init the directory so it's no longer tied to the iodocs master stuff, or just add it and delete it later. Pull a clone of my repo if you want :-)
So either (reset your repo):
% git init
% git add .
% git add -f config.json
% git commit -m "init"
or (update the current one):
git add config.json
git commit -a
% heroku create --stack cedar;
% heroku addons:add redistogo
% heroku addons:add logging
% git push heroku master
% heroku ps:scale web=1
This'll should get you a working app at .herokuapp.com
Fixing app.js to allow for heroku. Also adding config.json for heroku…
… test (will remove after)
Adding procfile for heroku
Adding the second needed piece to app.js for heroku
Removing config.json because we don't need it for the repo
Why would you add this code again here when you perform the same logic check and variable assignment a few lines above for the redis connection? Wouldn't it be cleaner to piggyback the config object earlier in the code so you don't add so many hooks for Heroku?
Sure, you could do that. I'm sure if you wanted to fork and make a cleanup pull request Neil would be happy to take it :-)
Fair enough. I'll have to beef up on my Git skills before I can do that. Which was one of my geek 2012 resolutions anyway.
Sounds good. If I have occasion to pull another branch for another change (there are a few on my list) I'll make sure to catch this as well.
Why was this block removed? I'm learning though this project and additional clarity would be appreciated. I see it works with or without it. In which case, why did it exist in the first place?
I think it was older code from a previous version.