-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make it possible to run frontend against staging backend #39
Conversation
This is such a brilliant idea, Lili! Thank you for the super clear and detailed description! Excited to try this out! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Let me know if you run into any troubles with this @mxosman ! (Either when trying to run locally as before or remotely) |
This reverts commit 745fc80.
This is cool! Had no issues running it with localhost and staging as the proxy host! |
@@ -0,0 +1,11 @@ | |||
const { createProxyMiddleware } = require("http-proxy-middleware"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: do we have a policy of making sure to include the Copyright (C) 2022 Recidiviz, Inc.
comment in every file? I noticed it missing in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man good question! It should be here! Do you know if this is automatically done/enforced in other repos?
Description of the change
So far, when developing, we have been running our backend locally in a Docker container on port localhost:5001 and then running our frontend against that via
proxy: localhost5001
inpackage.json
. This works fine, but there are a couple of reasons why we might want to run our frontend against a deployed version of our backend on staging:By default, the behavior will stay the same, but we can now run against staging via this command
REACT_APP_PROXY_HOST=<staging url> yarn run dev
.NOTE to @mxosman and @terryttsai -- once this gets merged, you will need to make a copy of
.env.example
and rename it to.env
(see updated README).Type of change
Checklists
Development
This box MUST be checked by the submitter prior to merging:
These boxes should be checked by the submitter prior to merging:
Code review
These boxes should be checked by reviewers prior to merging: