Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add a Procfile and get PORT from env working across dev/prod #226

Merged
merged 1 commit into from

2 participants

@themgt

made a few little changes to get this working consistently with Foreman and passing in an internal PORT but assuming production requests are being proxied on port 80

@thedjpetersen thedjpetersen merged commit e65aabf into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 7 deletions.
  1. +1 −0  Procfile
  2. +5 −5 config.js
  3. +2 −2 lib/webserver.js
View
1  Procfile
@@ -0,0 +1 @@
+web: ./subway start
View
10 config.js
@@ -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
4 lib/webserver.js
@@ -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);
}
Something went wrong with that request. Please try again.