justwondering justwondering - 2 years ago 52
Node.js Question

How do you set environment variables for Enide / Nodeclipse?

Anyone know how to set environment variables for running and debugging Node.js applications in Eclipse + Nodeclipse aka Enide Studio? For example, in a .js file, an environment variable can be referenced as

, for the environment variable PORT. How can I specify this variable within Enide?

Answer Source

I found the solution to my question. First, go to the menu item File > Properties. Then select Run/Debug Settings from the options on the left of the dialog. Then select the .js file for which you want to set an environment variable during debugging/running programs in Enide Studio / Eclipse + Nodeclipse. Then select the [Edit] button. On the dialog that appears, select the [Environment] tab. Then select the [New] button and enter in your desired variable name and value. Repeat for multiple environment variables. Click [Apply], then try running your program. Your environment values should be available as process.env.YOUR_VARIABLE_NAME in your Node.js source code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download