Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Adding host configuration feature #1101

Merged
merged 1 commit into from
Dec 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/env/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
googleAnalyticsTrackingID: process.env.GOOGLE_ANALYTICS_TRACKING_ID || 'GOOGLE_ANALYTICS_TRACKING_ID'
},
port: process.env.PORT || 3000,
host: process.env.HOST || '0.0.0.0',
templateEngine: 'swig',
// Session Cookie settings
sessionCookie: {
Expand Down
2 changes: 2 additions & 0 deletions config/env/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module.exports = {
certificate: './config/sslcerts/cert.pem'
},
port: process.env.PORT || 8443,
// Binding to 127.0.0.1 is safer in production.
host: process.env.HOST || '0.0.0.0',
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean',
options: {
Expand Down
4 changes: 2 additions & 2 deletions config/lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ module.exports.start = function start(callback) {

_this.init(function (app, db, config) {

// Start the app by listening on <port>
app.listen(config.port, function () {
// Start the app by listening on <port> at <host>
app.listen(config.port, config.host, function () {

// Logging initialization
console.log('--');
Expand Down