168
rated 0 times
[
172]
[
4]
/ answers: 1 / hits: 78894
/ 9 Years ago, tue, may 5, 2015, 12:00:00
I would like to check if an environment variable is set in my Express JS server and perform different operations depending on whether or not it is set.
I've tried this:
if(process.env.MYKEY !== 'undefined'){
console.log('It is set!');
} else {
console.log('No set!');
}
I'm testing without the process.env.MYKEY
but the console prints It is set.
More From » node.js