client/
scriptWhichMakesApiCall/
await axios.get("http://localhost:${REACT_PORT}/api/product-category");
Doing "npm run build". REACT_PORT value is baked into build.
server/
express which dynamically assigns itself some PORT.
我的法规基础可以作些什么修改,以便我的建筑反应使我所说的话听起来的准确港?
I have hard coded the PORT number in react app. Build it. Also hard coded the PORT number in express. This doesn t seem robust.