How does create-react-app set up api agents in production and test environments

for example, the address of my test environment is https://www.google.com
. Then how should I set up build.js and start.js under scripts file without frequently switching proxy
under package.json? What should be set?

Mar.20,2021

build a project using create-react-app, for example, using axios,
Development Environment
in the package.json file, add (just add to the bottom curly braces)
"proxy": "http://localhost:9093/"
means that the request has been forwarded to http://localhost:8080/

production environment requires nginx to forward


if you use axios, you can configure the unified request path. (the production environment address
proxy writes the test environment address normally.


don't know what you mean? If it is a local link for production debugging, you can add a localstorage attribute to your environment configuration file to judge, and modify the environment configuration parameters dynamically through the console to modify localstorage.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beff8d-31cb5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beff8d-31cb5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?