Using environment variables with Node.js applications

One of the most significant Acquia Cloud user interface functions is the handling of environment variables for your Node.js applications. These variables are set globally, on a per-application basis, and can be used to define anything your Node.js application may need to work with, including Drupal APIs and environments.

The Acquia Cloud user interface enables you to add, edit, and delete variables quickly and easily. Because working with variables is restricted by permissions, the Acquia Cloud interface will contain appropriate items for working with variables only if you have adequate permissions.

Cloud environment variables list

By default, the value of the variable is hidden for security. Click Show to display the value, or Hide to hide it from view again.

Adding a variable

Using the Acquia Cloud interface, complete the following steps to add an environment variable:

  1. Sign in to your Acquia Cloud account, and then select your Node.js application.
  2. Select the environment to which you want to add a variable.
  3. Click Variables, and then click Add Environment Variable.
  4. Add the information for your variable:
    • Name - Example: Drupal_API_URL
    • Value - Example: http://mydrupalsite.com/api
  5. Click Add to add the variable, or click Cancel to discard your changes.

You should now have a variable in the Environment Variables list.

Editing a variable

If you have a problem or need to update an existing variable, you can edit them from the Variables page, using the following procedure:

  1. Sign in to your Acquia Cloud account, and then select your Node.js application.
  2. In the left menu, click Variables.
  3. Find the variable that you want to change, and then click its Edit link.
  4. Replace the information in the Value text box with your updated data.
  5. Click Update.

Acquia Cloud will display your variable's new value in the list.

Removing a variable

To remove an environment variable from use, complete the following steps:

  1. Sign in to your Acquia Cloud account, and then select your Node.js application.
  2. In the left menu, click Variables.
  3. Find the variable that you want to delete, and then click its Remove link.
  4. Click Update.

Acquia Cloud will remove your variable from the list.

Filtering for specific variables

If you need to find a specific environment variable, you can use the Filter Variables field in the upper-right of the webpage. This will filter your displayed variables based on your entered text.

Contact supportStill need assistance? Contact Acquia Support