Permalink
Browse files

Adding the second needed piece to app.js for heroku

  • Loading branch information...
1 parent 17063a4 commit 527ab8369cb6a0496b6e1cddfad3d1e1501a7eb9 @synedra synedra committed Jan 6, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 app.js
View
@@ -80,6 +80,13 @@ fs.readFile('public/data/apiconfig.json', 'utf-8', function(err, data) {
var app = module.exports = express.createServer();
+if (process.env.REDISTOGO_URL) {
+ var rtg = require("url").parse(process.env.REDISTOGO_URL);
+ config.redis.host = rtg.hostname;
+ config.redis.port = rtg.port;
+ config.redis.password = rtg.auth.split(":")[1];
+}
+
app.configure(function() {
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');

4 comments on commit 527ab83

@jasonmccreary

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?

@synedra
Contributor

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 :-)

@jasonmccreary

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.

@synedra
Contributor

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.

Please sign in to comment.