I'm not sure where it is documented, but it enables you to define different
environments.
Say you want a "dev" and "prod" environment. Before you fire up your app,
you would do something like this:
$ NODE_ENV={ENV} node app.js
$ NODE_ENV=dev node app.js => dev environment
$ NODE_ENV=prod node app.js => prod environment
Then within your app, you can access this value like this:
process.env.NODE_ENV
This is especially prevalent in express where you can set different
environment configurations:
app.configure("dev", function (req, res) {
// do only dev things here
})
app.configure("prod", function (req, res) {
// do only prod things here
})
hope that helps.
dale
On Sun, Mar 18, 2012 at 1:13 PM, Peng Yu <[email protected]> wrote:
> Hi,
>
> I'm not able to find where NODE_ENV is documented and what it is for.
> Could anybody point me where the document is?
>
> Regards,
> Peng
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
--
--
CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents,
files or previous e-mail messages attached to it may contain confidential
information that is legally privileged and is intended for the designated
recipient only. If you have received it in error, please notify the sender
immediately and delete the original. Any other use of the email by you is
STRICTLY PROHIBITED.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en