Web site formal and test data and backend planning problems

suppose a web site has a backend, and the default is test.com/admim
(test.com is my own personal domain and must be encrypted to log in, so the test will have a test manager account, and there will be an official manager account), and you can add back-end operations such as delete data. This backend is all data for testing (dev).
one day this web site is going to prod. The domain name of the official web site is called abc.com,. The original database is dev, but now it has been changed to prod

.

test.com/admin-> db:dev
abc.com-> db:prod

what portal will my network address use as the backstage? And how to judge and formalize in the backstage?
because it is not possible to use abc.com/admin as the backstage of formal data management.

my practice is
regardless of whether the test is formal or formal, the backend will have a unified access to test.com/admin
, but you can choose whether you want to buy formal data or test data, and you may use $_ GET to judge the situation (but using GET to indicate that this value must be added at the back of each network address.)
I think what would you do if it were you?

Aug.24,2021

Is

a Taiwan compatriot?

the database configuration is placed in the configuration file, which is not submitted to the git repository. The configuration is modified only at deployment time, and continuous integration tools can be used.


it seems to me that your problem is because both domain names have to be mapped to the same set of code on the same server. If so, you do need to consider how to identify the formal / test environment:
I think the environment can be judged by host , test.com / abc.com , these are two values that can be obtained. For
domain name, you can use test.com/admin for testing. For formal deployment, if abc.com is specifically set as a backend domain name, you can directly use abc.com , and then set the rewriting rule /-> / admin in apache/nginx (I'm not sure how to set it. (embarrassing), you can also add the suffix / admin .

if the domain name is not mapped to the same set of codes, it is recommended to use abc.com and apache/nginx to set the rewriting rule directly for formal deployment. For database, you can change it in the configuration file.

Whether

is a formal library or a test library, you can write this configuration in the configuration file. Just modify the configuration file to read the data in the formal library when you deploy the official website.


Database configurations are all placed in the configuration file, so ok


is the case. Generally speaking, it is a single server for dev and a single server for prod.
if there is only one server, you can prepare two codes on one service. One dev corresponds to test.com, and one prod corresponds to abc.com

.
Menu