You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we are using the proxy for create-react-app to proxy requests to a staging server and it works great. We have several environments hosted for development and production (e.g. staging, testing, prod, BSEs, and occasionally long-lived feature branches). If we want to change what server we are proxying to we need to change the field in package.json and remember to revert this change before committing. This frustrates me because I very frequently forget and commit this change.
Describe the solution you'd like
I'd like to be able to set the proxy via environment variables so that it is configurable without having to change tracked files. This would allow us to add environment variables in the shell and not have to change tracked files to change the proxy. I'd like to append || proccess.env.PROXY to line 111 of react-scripts/scripts/start.js
Describe alternatives you've considered
We looked into using 'http-proxy-middleware' to setup a custom proxy that will proxy off environment variables. We are currently not prefixing our endpoints and setting up 'http-proxy-middleware' for a custom proxy to work on environment variables would require some refactoring of the application and how we are integrating with third party software we are using for authorization and processing payments.
Additional context
(Write your answer here.)
The text was updated successfully, but these errors were encountered:
Is your proposal related to a problem?
Currently, we are using the proxy for create-react-app to proxy requests to a staging server and it works great. We have several environments hosted for development and production (e.g. staging, testing, prod, BSEs, and occasionally long-lived feature branches). If we want to change what server we are proxying to we need to change the field in package.json and remember to revert this change before committing. This frustrates me because I very frequently forget and commit this change.
Describe the solution you'd like
I'd like to be able to set the proxy via environment variables so that it is configurable without having to change tracked files. This would allow us to add environment variables in the shell and not have to change tracked files to change the proxy. I'd like to append
|| proccess.env.PROXY
to line 111 of react-scripts/scripts/start.jsDescribe alternatives you've considered
We looked into using 'http-proxy-middleware' to setup a custom proxy that will proxy off environment variables. We are currently not prefixing our endpoints and setting up 'http-proxy-middleware' for a custom proxy to work on environment variables would require some refactoring of the application and how we are integrating with third party software we are using for authorization and processing payments.
Additional context
(Write your answer here.)
The text was updated successfully, but these errors were encountered: