TheOdinProject / curriculum

The open curriculum for learning web development
https://www.theodinproject.com/
Other
9.99k stars 13.35k forks source link

Environment Variables: mention NODE_ENV #28507

Closed damon314159 closed 2 months ago

damon314159 commented 2 months ago

Checks

Describe your suggestion

One of the examples on the env vars lesson shows a variable called MODE and compares it against production. The conventional name would be NODE_ENV.

I can understand that perhaps referencing NODE_ENV might be misleading since maybe someone new to this thinks the words node and env are specific meaningful keys or something like that, but the learner will absolutely see NODE_ENV when researching bits and bobs, so I think it needs a mention to tackle that head on.

I think all it needs is a comment inside the code block underneath the process.env.MODE part that says something like: // Conventionally, we use 'NODE_ENV' to specify production or development, but the names are arbitrary and could be anything you choose

Path

Node / JS

Lesson Url

https://www.theodinproject.com/lessons/nodejs-environment-variables

MaoShizhong commented 2 months ago

Actually, I'm not entirely sure why I used MODE instead of NODE_ENV. It would be better to use NODE_ENV, then just briefly mention it's the conventionally name for the "mode" when first introduced.

I'll assign this to you.