-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-scripts dev server: Support PROXY env var for overridable "proxy" #8598
base: main
Are you sure you want to change the base?
react-scripts dev server: Support PROXY env var for overridable "proxy" #8598
Conversation
Hi @unclechu! Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
What is the use case? What does the current proxy solution not solve? |
@ianschmitz As I showed in the example you can for instance have few commands to run a frontend using either local backend server or some testing/staging server. With this environment variable you don't have to change |
In short words: it adds more flexibility to the proxy feature. |
You should be able to achieve your desired behavior today (two different scripts for diff environments) using environment variables within |
@ianschmitz It required more effort to do it using But yes, it's possible to do kind of-ish the same, with more effort and more boilerplate. You're free to close this one but I think this offers a lot more simpler way of doing this whilst adding one line of code and couple of symbols to another line is not a trade-off at all. |
We've updated the docs page which will be published with the next release. I'll see if there's appetite from the other maintainers. Historically the proxy has been a tricky subject with lots of weird edge cases which is why we're generally hesitant to make changes there. Hope you understand. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Not stale bump |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Not stale bump |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Not stale bump |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Nope |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Nah |
+1 |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
bump |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Nope |
Usage example:
Or as a
script
inpackage.json
: