In the course of development, you will inevitably encounter application deployment in at least three environments: development, test, and production. It is possible to use a set of database configuration, path configuration, and so on in each environment. If you manually interfere with each configuration file each time, the work will be cumbersome and easy to miss and error. That’s one thing.

At development time, some code runs only at development time and does not run at release time. For example: mock data for testing, automatic login to debug the application, features that are not live this time, etc. That’s the second part.

The tester had to switch back and forth between the test server and the online server, and it was often difficult for testers and developers to connect to the test server and the online server by typing different packages. This is number three.

How to solve the problem? In fact, eoLinker only needs to realize automatic configuration switch of development environment, test environment and production environment through environment management.

Before switching to environment management, we need to know what is development environment, test environment, and production environment. What is the purpose of switching? What is the development convenience of switching environments?

Development environment: the development environment is a server specially used for development by the program apes. Configuration can be more random. In order to facilitate development and debugging, it is generally open all error reports.

Test environment: generally a copy of the production environment configuration is cloned, a program does not work properly in the test environment, so it must not be released to the production machine.

Production environment: In the production environment, external services are formally provided. Generally, error reporting is disabled and error logs are enabled.

The three environments can also be said to be the three stages of system development: development -> test -> go live, in which the production environment is usually referred to as the real environment. It is the product environment directly contacted by online users, and its performance level is final, directly affecting the user experience. Therefore, production environment should consider performance, development environment can not be directly applied to the production environment, we need to optimize the parts of the environment can be optimized.

Next comes the hands-on part of environmental management.

Environmental management (Note: the professional version has the same function as the free version, and the free version can use all the functions of environmental management)

EoLinker AMS offers the most powerful project environment management capabilities available today, enabling you to:

  • Change the request prefix for all API interfaces in one click (Base URL/ root path)

  • I’m gonna add a unified Header

  • Add the unified request parameter

  • Dynamically change request parameter values in all interfaces through global variables, etc

The same is true for header, request parameters, and global variables. In fact, extra parameters and global variables are the same meaning. Global variables are assigned values by {{userID}}, and additional parameters are automatically added.

How do I create a new environment? Need to modify and delete the environment? *

  • Create an environment

Go to the environment management page, click Add Environment button, and enter the related environment name (such as test environment or build environment) :

Click Save to create a new project environment.

  • To modify the environment

Click on the environment to be modified, modify the relevant content directly on the right side, and click Save:

Click and select delete button to delete the environment:

One-click Change of all root paths (Base urls)

EoLinker AMS provides the most powerful project environment management capability available today, enabling you to change the request prefix (Base URL/ root path) of all API interfaces with one click:

After creating the environment, fill in the leading URL and save the Settings:

Click the Switch Environment menu in the upper right corner of the interface list page or interface Details page and select the environment you want to switch. You will find that the API path has been automatically added with the URL in front of the environment:

Adding a unified Header

EoLinker AMS provides the most powerful project environment management capability available today, enabling you to add unified request headers for all interfaces with one click:

After creating the environment, fill in the request Header and save the Settings:

Click the Switch Environment menu in the upper right corner of the interface list page or interface Details page and select the environment you want to switch. You will find that the API path has automatically added the request header of the environment:

Add additional request parameters

EoLinker AMS provides the most powerful project environment management capability available, enabling you to add uniform additional request parameters to all interfaces with one click.

After creating the environment, fill in the additional request parameters and save the Settings:

On the interface list page or interface details page, click the Switch Environment menu in the upper right corner of the page and select the environment you want to switch. You will find that the API path has automatically added the additional request parameters of the environment.

Note: Additional request parameters do not show up in the details of the interface documentation, only in tests!

Using global variables

EoLinker AMS provides the most powerful project environment management capability available today, allowing you to dynamically change request parameters or in all interfaces through global variables. Parameter values, etc. :

After creating the environment, fill in the global variables and save the Settings:

In the interface details or test page, global variables are filled in with request parameters or values that are automatically replaced when the request is sent.

Enclosing the parameter name with two curly braces refers to global variables such as {{key}}, which can be used to:

Local address in the API URL, such as www.eolinker.com/{{key}} Parameter name and parameter value in the request header Parameter value and parameter value in the request parameter

In the following figure, the userToken parameter value is the global variable {{token}}. {{token}} will be automatically replaced by 1234567890 when the request is sent:

EoLinker is the world’s leading and China’s largest online API interface management platform, providing automatic API document generation, API automation testing, Mock testing, team collaboration and other functions, aiming to solve the problem of low development efficiency caused by the separation of front and back ends.

At present, eoLinker provides fast, professional and stable API management services for thousands of enterprises such as Google, IBM, Tencent, China Unicom, Haier, China Auto, Gome, Jiangsu Wangjin, Guanglianda, Chengsi Technology, And Laoyuegou.

At the same time, eoLinker is also a cooperative product and enterprise of Google Developer Alliance, and holds offline communication and sharing activities from time to time to promote the development of API management in China.

Chinese official website: www.eolinker.com

Github source: github.com/eolinker