I am working on a nodejs app, I want to perform some action when environment variable is set to '1' and different action when environment variable is set to '0'.
I manually change the value of this variable from '0' to '1'. I still value '0' being printed. It didn't recognize the value change. Is there any better to read value from registry?
Note: I use process.env.variable_name
Here is the code snippet
function setVar () {
if(process.env.Env_Variable_test) {
console.log('It is set!');
console.log(process.env.Env_Variable_test);
}
else {
console.log('No set!');
console.log(process.env.Env_Variable_test);
}
}