Skip to content

Instantly share code, notes, and snippets.

@marcusoftnet
Created February 23, 2015 01:35
Show Gist options
  • Save marcusoftnet/68d7bb7bf61fb08aeb91 to your computer and use it in GitHub Desktop.
Save marcusoftnet/68d7bb7bf61fb08aeb91 to your computer and use it in GitHub Desktop.
Config object
var mongoProdUri = process.env.MONGOLAB_URI || 'localhost:27017/myApp_Prod';
var adminUser = {
name : process.env.BASIC_USER || 'marcus',
pass : process.env.BASIC_PASS || 'koavote'
};
var config = {
local: {
mode: 'local',
port: 3000,
mongoUrl: 'localhost:27017/myApp_Dev',
user : adminUser
},
staging: {
mode: 'staging',
port: 4000,
mongoUrl: 'localhost:27017/myApp_Test',
user : adminUser
},
prod: {
mode: 'prod',
port: process.env.PORT || 5000,
mongoUrl: mongoProdUri,
user : adminUser
}
};
module.exports = function (mode) {
return config[mode || process.argv[2] || 'local'] || config.local;
};
@james-gardner
Copy link

Cool stuff! Do we really need the || 'local' in here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment