Last active
August 29, 2015 14:09
-
-
Save electblake/cfc894a615159de88c60 to your computer and use it in GitHub Desktop.
12factor Combined .env Sample - /app/lib/config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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