Skip to content

Instantly share code, notes, and snippets.

@marcusoftnet
Created April 21, 2014 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusoftnet/11142947 to your computer and use it in GitHub Desktop.
Save marcusoftnet/11142947 to your computer and use it in GitHub Desktop.
simpleConfigobject
var mongoDevUri = process.env.MONGOHQ_URL || "localhost:27017/koaVote_Dev";
var mongoStageUri = process.env.MONGOHQ_URL || "localhost:27017/koaVote_Test";
var mongoProdUri = process.env.MONGOHQ_URL || "localhost:27017/koaVote_Prod";
var config = {
local: {
mode: 'local',
port: 3000,
mongoUrl: mongoDevUri
},
staging: {
mode: 'staging',
port: 4000,
mongoUrl: mongoStageUri
},
prod: {
mode: 'prod',
port: process.env.PORT || 5000,
mongoUrl: mongoProdUri
}
};
module.exports = function (mode) {
return config[mode || process.argv[2] || 'local'] || config.local;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment