Closed perNyfelt closed 3 years ago
The proxy configuration behaves slightly different than the react proxy config in package.json.
In the example configuration i.e.
"proxies": { "/api/": { "origin": "${API_URL}" } }
The setting of the API_URL variable is given the example of
heroku config:set API_URL="https://backend.example.com"
This means a url such as /api/login will be https://backend.example.com/login. Most likely the backend url would correspond to what has been tested locally and thus end with /api. If the API_URL instead would be set to
/api/login
https://backend.example.com/login
heroku config:set API_URL="https://backend.example.com/api"
Then a call to /api/login would become https://backend.example.com/api/login which is probably more intuitive.
https://backend.example.com/api/login
It would be nice to mention this in the readme.md#user-content-proxy
This is already documented in Proxy URL config section of the README documentation.
The proxy configuration behaves slightly different than the react proxy config in package.json.
In the example configuration i.e.
The setting of the API_URL variable is given the example of
This means a url such as
/api/login
will behttps://backend.example.com/login
. Most likely the backend url would correspond to what has been tested locally and thus end with /api. If the API_URL instead would be set toThen a call to
/api/login
would becomehttps://backend.example.com/api/login
which is probably more intuitive.It would be nice to mention this in the readme.md#user-content-proxy