Here is the way in which I set up different API URL based on the current environment:
Development and Production, on npm, commanded setup env.
Is there are some more elegant solution cus my URLs are long:
Package.json
"scripts": {
"start": "REACT_APP_BASE_URL=http://test-dev-1323211.us-east-1.elb.amazonaws.com/api/3.0 react-scripts start",
"build": "REACT_APP_BASE_URL=http://test-1323211.us-east-1.elb.amazonaws.com/api/3.0 react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"prepare": "husky install",
},