Environment Management
An environment is a container where the API runs. When creating an API, you can specify environment variable parameters which are parsed into different corresponding values when accessed. An environment has Region and Project attributes which cannot be changed once created.
Create an Environment
The backend program often needs to perform different operations or calls for different environments, such as reading different configuration files, accessing different services, etc. The environment can work with the developer to easily complete these tasks. Switch to the “Environment Management” menu, click “Create Environment”, select the API group name, enter the “Environment Name” and “Environment Description”, and click OK.
Create Environment Variables
Creating environment variables is a prerequisite for deploying APIs that use environment variables. For example, if you have defined /${StageVariable.userName} in the API backend path, you need to create a variable named userName in the environment management. Environment variables are parsed into the corresponding environment variable values when the API is deployed. Therefore, remember to republish the API after modifying the environment variables to avoid the ineffective of the modified environment variables.