Last active
December 12, 2017 17:19
-
-
Save yelworc/84c4cfbe72f1476b9918209cbd71b90d to your computer and use it in GitHub Desktop.
heroku-env-test
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
const nconf = require('nconf'); | |
const TESTCASES = [ | |
'plaintest', | |
'underscore_test', | |
'colon:test', | |
'hyphen-test', | |
'dot.test', | |
]; | |
nconf.env(); | |
TESTCASES.forEach(name => { | |
console.log(`process.env['${name}']:`, process.env[name]); | |
console.log(`nconf.get('${name}'):`, nconf.get(name)); | |
}); | |
Object.keys(process.env).forEach(k => { | |
if (process.env[k] === 'foo') console.log(`process.env['${k}'] === 'foo'`); | |
}); |
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
{ | |
"name": "heroku-env-test", | |
"version": "1.0.0", | |
"description": "Minimal test app to reproduce an issue with environment variables on Heroku", | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Markus Dolic <[email protected]>", | |
"license": "WTFPL", | |
"dependencies": { | |
"nconf": "^0.9.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment