Working with NodeJS environment variables (such as for server specific settings)

To set an environment variable that NodeJS can access, in a DOS prompt:

set variableName=value

To access this value in your NodeJS, you can reference:


Note that while this is great for a Node app, or something like Webpack that runs in Node, you CAN NOT use it in React components, because they are not run through Node.