> I'm not sure where it is documented, but it enables you to define different
> environments.

It's not documented in node core because it's just a convention, made
popular by express. Node itself doesn't care what the environment vars
are really, it just lets you read and write them via
http://nodejs.org/docs/latest/api/process.html#process_process_env .

--Josh

On Sun, Mar 18, 2012 at 11:14 AM, dale tan <wtd...@gmail.com> wrote:
> 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 <pengyu...@gmail.com> 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 nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en



-- 
Joshua Holbrook
Engineer
Nodejitsu Inc.
j...@nodejitsu.com

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to