Permalink
Browse files

Merge pull request #226 from themgt/env-config

add a Procfile and get PORT from env working across dev/prod
  • Loading branch information...
2 parents 9673b12 + cb1b2cb commit e65aabfc21494f7294f94b1783591824533bb248 @thedjpetersen committed Mar 29, 2013
Showing with 8 additions and 7 deletions.
  1. +1 −0 Procfile
  2. +5 −5 config.js
  3. +2 −2 lib/webserver.js
View
@@ -0,0 +1 @@
+web: ./subway start
View
@@ -1,13 +1,13 @@
exports.dev = {
- port: 3000,
- client_port: 3000,
- mongoose_auth: 'mongodb://mongodb@localhost/subway'
+ port: process.env.PORT || 3000,
+ client_port: process.env.PORT || 3000,
+ mongoose_auth: process.env.MONGODB_URL || 'mongodb://mongodb@localhost/subway'
}
exports.prod = {
- port: 14858, // Nodester port
+ port: process.env.PORT || 14858, // Nodester port
client_port: 80, // Websockets talk on port 80 on Nodester, regardless of listen port
- mongoose_auth: 'mongodb://mongodb@localhost/subway'
+ mongoose_auth: process.env.MONGODB_URL || 'mongodb://mongodb@localhost/subway'
}
exports.misc = {
View
@@ -16,8 +16,8 @@ app.configure(function() {
// Configure app based on given environment config
function configureApp(app, envConfig) {
- app.set('port', process.env.PORT || envConfig.port);
- app.set('client_port', process.env.PORT || envConfig.client_port);
+ app.set('port', envConfig.port);
+ app.set('client_port', envConfig.client_port);
app.set('mongoose_auth', envConfig.mongoose_auth);
}

0 comments on commit e65aabf

Please sign in to comment.