Currently I'm using this pattern in code:
module.exports.getMySQL = () => {
return process.env.CLEARDB_DATABASE_URL || config.get('MySQL').connection;
}
however, node-config claims to be able to integrate these variables into a file as such.
https://github.com/lorenwest/node-config/wiki/Environment-Variables#custom-environment-variables
{
"Customer": {
"dbConfig": {
"host": "PROD_SERVER"
},
"credit": {
"initialDays": "CR_ID"
},
// Environment variables containing multiple configs
// New as of config@1.14.0
"settings": {
"adminAccounts": {
"__name": "ADMIN_ACCS",
"__format": "json"
}
}
}
}
What exactly is "PROD_SERVER"
If I replace this with "process.env.SOME_ENVIRONMENT_VARIABLE"
, it does not work and my server crashes.
I did verify that "process.env.SOME_ENVIRONMENT_VARIABLE"
exists using the Heroku GUI.