Merge pull request #1101 from farajfarook/master

Adding host configuration feature
This commit is contained in:
Liran Tal
2015-12-25 08:39:24 +02:00
3 changed files with 5 additions and 2 deletions

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -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('--');