Skip to content

Instantly share code, notes, and snippets.

@electblake
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save electblake/cfc894a615159de88c60 to your computer and use it in GitHub Desktop.

Select an option

Save electblake/cfc894a615159de88c60 to your computer and use it in GitHub Desktop.
12factor Combined .env Sample - /app/lib/config.js
var config = require('12factor-config'),
path = require('path'),
fs = require('fs');
// load .env file from relative ../.env
var envFile = path.join(__dirname, '../', '.env');
if (fs.existsSync(envFile)) {
var env = require('node-env-file');
env(envFile, { overwrite: true});
}
// Load 12factor config
var cfg = config({/*...*/});
module.exports = exports = cfg;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment