Skip to content
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

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

lilidworkin
Copy link
Collaborator

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 in package.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:

  • Contractors who don't have access to our Docker container
  • To test out performance/latency on staging
  • To test against our staging database

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

All pull requests must have at least one of the following labels applied (otherwise the PR will fail):

Label Description
Type: Bug non-breaking change that fixes an issue
Type: Feature non-breaking change that adds functionality
Type: Breaking Change fix or feature that would cause existing functionality to not work as expected
Type: Non-breaking refactor change addresses some tech debt item or prepares for a later change, but does not change functionality
Type: Configuration Change adjusts configuration to achieve some end related to functionality, development, performance, or security
Type: Dependency Upgrade upgrades a project dependency - these changes are not included in release notes

Checklists

Development

This box MUST be checked by the submitter prior to merging:

  • Double- and triple-checked that there is no Personally Identifiable Information (PII) being mistakenly added in this pull request

These boxes should be checked by the submitter prior to merging:

  • Tests have been written to cover the code changed/added as part of this pull request

Code review

These boxes should be checked by reviewers prior to merging:

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has been moved out of a Draft state, has no "Work In Progress" label, and has assigned reviewers
  • Potential security implications or infrastructural changes have been considered, if relevant

@mxosman
Copy link
Contributor

mxosman commented Sep 23, 2022

This is such a brilliant idea, Lili! Thank you for the super clear and detailed description! Excited to try this out!

Copy link
Contributor

@mxosman mxosman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@lilidworkin
Copy link
Collaborator Author

Let me know if you run into any troubles with this @mxosman ! (Either when trying to run locally as before or remotely)

@terryttsai
Copy link
Contributor

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");
Copy link
Contributor

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

Copy link
Collaborator Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants