Skip to content

Commit

Permalink
chore(config): prepare to run in development mode with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dciccale committed Apr 14, 2015
1 parent 3bdf6a7 commit 12cceb5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions config/environment/development.js
@@ -1,12 +1,15 @@
'use strict';

var MONGO_ADDR = process.env.MONGO_PORT_27017_TCP_ADDR || 'localhost';
var MONGO_PORT = process.env.MONGO_PORT_27017_TCP_PORT || 80;

// Development specific configuration
// ==================================
module.exports = {

// MongoDB connection options
mongo: {
uri: 'mongodb://localhost/node-api-docker-boilerplate-dev',
port: 80
uri: 'mongodb://' + MONGO_ADDR + ':' + MONGO_PORT + '/node-api-docker-boilerplate-dev'
},

seedDB: true
Expand Down
2 changes: 1 addition & 1 deletion config/environment/index.js
Expand Up @@ -8,7 +8,7 @@ var all = {
env: process.env.NODE_ENV,

// Server port
port: process.env.PORT || 8888,
port: process.env.PORT || 9001,

// Should we populate the DB with sample data?
seedDB: false,
Expand Down
1 change: 1 addition & 0 deletions config/environment/production.js
Expand Up @@ -6,6 +6,7 @@ var MONGO_ADDR = process.env.MONGO_PORT_27017_TCP_ADDR || 'localhost';
var MONGO_PORT = process.env.MONGO_PORT_27017_TCP_PORT || 80;

module.exports = {

// Server IP
ip: process.env.IP || undefined,

Expand Down
7 changes: 5 additions & 2 deletions config/environment/test.js
@@ -1,11 +1,14 @@
'use strict';

var MONGO_ADDR = process.env.MONGO_PORT_27017_TCP_ADDR || 'localhost';
var MONGO_PORT = process.env.MONGO_PORT_27017_TCP_PORT || 80;

// Test specific configuration
// ===========================
module.exports = {

// MongoDB connection options
mongo: {
uri: 'mongodb://localhost/node-api-docker-boilerplate-test',
port: 80
uri: 'mongodb://' + MONGO_ADDR + ':' + MONGO_PORT + '/node-api-docker-boilerplate-test'
}
};

0 comments on commit 12cceb5

Please sign in to comment.