Skip to content

Commit 0931123

Browse files
committed
tweaked to work on Heroku
1 parent 824e202 commit 0931123

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: node app.js

app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ function serveTest(query, response)
399399
response.end();
400400
}
401401

402+
var port = Number(process.env.PORT || process.env.VCAP_APP_PORT || 5000);
403+
402404
http.createServer(function (request, response)
403405
{
404406
var parsedUrl = url.parse(request.url);
@@ -437,7 +439,7 @@ http.createServer(function (request, response)
437439
response.end();
438440
}
439441

440-
}).listen(process.env.VCAP_APP_PORT || 8888);
442+
}).listen(port);
441443

442-
util.puts("Server running");
444+
util.puts("Server running on port " + port);
443445

0 commit comments

Comments
 (0)