How to use eoLinker for environment management in project development: development, testing and production environments

In the process of development, it is inevitable to encounter program deployment in at least three environments: development, testing and production environments.
A set of database configuration, path configuration, etc. may be used in each environment. If each configuration file is manually intervened every time, the work will be complicated, and it is easy to miss and make mistakes. This is one of them.

At development time, there is some code that only runs at development time and not at release time. For example: mock data for testing, automatic login to facilitate application debugging, functions that will not go online this time, etc. This is the second.

The tester needs to switch back and forth between the test server and the online server. It is often necessary to make different packages for connecting the test server and the online server, which is very troublesome for the tester and the developer. This is the third.
write picture description here
How to solve the trouble, in fact, only through the environment management of eoLinker to realize the automatic switching of the configuration of development environment, test environment and production environment.
write picture description here
Before talking about the switching of environment management, we must know what the development environment, test environment, and production environment are? What is the purpose of switching? What kind of development convenience can the convenient switching environment bring?

Development environment: The development environment is a server specially used by programmers for development, and the configuration can be arbitrary. For the convenience of development and debugging, all error reports are generally opened.

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

Production environment: It refers to the official provision of external services. Generally, the error report will be turned off and the error log will be turned on.

The three environments can also be said to be the three stages of system development: development -> testing -> online , in which the production environment is commonly referred to as the real environment. It is the product environment that online users directly contact, and its performance level is final, which directly affects the user's sense of experience. Therefore, the production environment should consider performance, and the development environment cannot be directly used as the production environment. We need to optimize the parts of the environment that can be optimized.

write picture description here

Next comes the practical part of environmental management.

Environmental management (note: the professional version and the free version have the same functions, the free version can use all the functions of environmental management)

eoLinker AMS provides the most powerful project environment management capabilities available, allowing you to:

  • Modify the request prefix (Base URL/root path) of all API interfaces with one click
  • Plus unified Header
  • Plus unified request parameters
  • Dynamically change request parameter values ​​in all interfaces through global variables, etc.

The Base URL is added uniformly, which is convenient for testing. It is not necessary to fill in the Base URL when testing each interface. The same is true for the analogy of headers, request parameters, and global variables. In fact, extra parameters and global variables have the same meaning. Global variables are passed through { {userID}} is assigned, and extra parameters are added automatically.

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

  • Create an environment

Enter the environment management page, click the Add environment button, and enter the relevant environment name (such as test environment, build environment, etc.):

write picture description here

Click Save to create a new project environment.

  • Modify the environment

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

write picture description here

After clicking, select the Delete button to delete the environment:

write picture description here

Modify all root paths with one click (Base Url)

eoLinker AMS provides the most powerful project environment management function. You can use it to modify the request prefix (Base URL/root path) of all API interfaces with one click:
After creating the environment, fill in the prefix URL and save the settings:

write picture description here

On the interface list page or the interface details page, click the switch environment menu in the upper right corner of the page, select the environment you want to switch, and you will find that the API path has been automatically added to the pre-URL of the environment:

write picture description here

Add unified header

eoLinker AMS provides the most powerful project environment management function. You can use it to add a unified request header (Header) to all interfaces with one click:
After creating the environment, fill in the Request Header header and save the settings:

write picture description here

On the interface list page or interface details page, click the switch environment menu in the upper right corner of the page, select the environment you want to switch, and you will find that the API path has been automatically added to the request header of the environment:

write picture description here

Add extra request parameters

eoLinker AMS provides the most powerful project environment management function, through which you can add unified additional request parameters to all interfaces with one click.

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

write picture description here

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

Note: The extra request parameters are not displayed in the details of the interface document, only in the test!

write picture description here

Use global variables

eoLinker AMS provides the most powerful project environment management function. You can dynamically change the request parameters or parameters in all interfaces through global variables. parameter values, etc.:
After creating the environment, fill in the global variables and save the settings:

write picture description here

On the interface details or test page, fill in the global variable into the request parameter or value, and it will be automatically replaced with the corresponding value when the request is sent.

By wrapping the parameter name with two curly brackets, you can refer to a global variable, such as {{key}}. Global variables can be used for:

Partial address in API URL, such as www.eolinker.com/{{key}}
parameter name and parameter value of
request parameter

As shown in the figure below, the parameter value of userToken is the global variable {{token}}, which will automatically replace {{token}} with the set 1234567890 when sending a request:

write picture description here

eoLinker is currently the world's leading and China's largest online API interface management platform. It provides functions such as automatic API document generation, API automated testing, Mock testing, and team collaboration. It aims 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, UCAR, Gome, Jiangsu Wangjin, Glodon, Chengsi Technology, and Laoyuegou. .
At the same time, eoLinker is also a cooperative product and enterprise of Google Developers Alliance, and holds offline exchange and sharing activities from time to time to promote the development of domestic API management.

Chinese official website: https://www.eolinker.com
github source code: https://github.com/eolinker

write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326053151&siteId=291194637