I was just wondering if i can find out what is the current value of NODE_ENV
(i.e. either development or production) in a express code (so i can't use app.configure('production' function(){})
).
By default, the environment variable is unset and defaults to development.
Solved: start by typing node and pressing enter, then type process. env and press enter.
NODE_ENV is an environment variable that stands for node environment in express server. The NODE_ENV environment variable specifies the environment in which an application is running (usually, development or production).
Try process.env.NODE_ENV
It should do the trick.
Within your express script, app.settings.env
should house that value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With