Articles in this section

How to copy PLATFORM_VARIABLES into Node's process.env?

Environment variables entered via the Management Console are stored in $PLATFORM_VARIABLES. In Node, you may need to have them in process.env so that these UI-entered values override statically defined values in the code.

There are a few workarounds for this:

  • Use the env: prefix in the UI to expose them as normal environment variables.  For example, setting env:MY_VAR will create an environment variable called $MY_VAR in your project's environments.
  • Make use of the platformsh-config library which can expose variables and other environment specific information to your application.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.