Configuring Environment Variables Locally
For security reasons, local development doesn't have access to the environment
variables that you set in the Zuplo Portal. Instead, set them in .env files.
Your gateway and your Developer Portal read different files, just as they read different variables when deployed. See Gateway and Developer Portal Variables.
.env files can contain sensitive information, so don't commit them to source
control. Add .env to your .gitignore file.
Gateway Variables
Your local gateway loads environment variables from a .env file in the root of
your project:
.env
Read them the same way as in a deployed gateway. See Gateway environment variables.
When you run zuplo dev, ZUPLO_ENVIRONMENT_STAGE is local.
zuplo link writes a .env.zuplo file with details about the linked account,
project, and environment. zuplo dev loads it along with .env. Don't edit
.env.zuplo; zuplo link replaces it each time it runs. Put your own variables
in .env.
Developer Portal Variables
Your local Developer Portal reads variables from a .env file in the portal's
own folder (usually docs/), not from the gateway's .env file. As in a
deployed portal, only variables that start with ZUPLO_PUBLIC_ or
ZUDOKU_PUBLIC_ are available:
docs/.env
See Dev Portal environment variables.