Skip to content

Instantly share code, notes, and snippets.

@yelworc
Last active December 12, 2017 17:19
Show Gist options
  • Save yelworc/84c4cfbe72f1476b9918209cbd71b90d to your computer and use it in GitHub Desktop.
Save yelworc/84c4cfbe72f1476b9918209cbd71b90d to your computer and use it in GitHub Desktop.
heroku-env-test
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'`);
});
{
"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