I am learning NodeJS and I need to know how to set my production environment using process.env.___
.When I run
console.log(app.get('env')); //app is express object
I get output on command prompt development
as environment. But if I try to set an environment variable
eg. process.env.NODE_ENV
, on command prompt I write :set NODE_ENV=production
and then again try : console.log(process.env.NODE_ENV);
I get output: undefined
.
I've been struggling hard and searching online but have't got a solution yet.
Please, guide me in this matter.