I am setting a variable in Express.js as follows: app.set('HOST', 'demo.sample.com');. However, if I try to read this variable, I get undefined as the output. I am reading the variable using process.env.HOST. Nevertheless, if I try to read it using app.get('HOST'), I get the correct value.
I cannot use app.get('HOST') since I am reading the variable in another file too — a file that does not contain a reference to the Express.js app variable.
How do I get the value using process.env.HOST?