Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

node.js - how to find out the current NODE_ENV the express app is running under?

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(){})).

question from:https://stackoverflow.com/questions/9441287/how-to-find-out-the-current-node-env-the-express-app-is-running-under

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try process.env.NODE_ENV

It should do the trick.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...