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

Revert API Url in Dev to localhost #108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

timimsms
Copy link
Contributor

@timimsms timimsms commented Apr 21, 2020

Description

Reverts the .env file's stored REACT_APP_DEV_API_URL ENV variable to the expected local URL.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • The console is clean. No errors or linting warnings

N/A - best practice / documentation improvements

@timimsms timimsms requested a review from Matt-Vance April 21, 2020 08:09
@timimsms timimsms self-assigned this Apr 21, 2020
@timimsms timimsms force-pushed the chore/revert-api-dev-url branch from ca0fed1 to d6c25c3 Compare April 21, 2020 08:09
@timimsms
Copy link
Contributor Author

@GreenWithMV this shouldn't really matter all that much, but may be a little confusing for new members of the group getting setup having this ENV hit production's API by default.

@Matt-Vance
Copy link
Collaborator

Would this need to get added to the readme? Because if I just want to edit frontend I will need to know that I need to clone that repo or revert back to directing to the live backend

@timimsms
Copy link
Contributor Author

timimsms commented Apr 22, 2020

@GreenWithMV great point!

What if we add a third ENV variable that's something like REACT_APP_API which can have the value of either DEV or PROD? This ensures the following two lines will always remain the same/unchanged:

REACT_APP_DEV_API_URL=http://localhost:4000/graphql
REACT_APP_PROD_API_URL=https://geornal-backend.herokuapp.com/graphql

Then we can add something like this to the README:


When running the application locally you must connect to a valid API for handling requests. You can either utilize a local backend server or the production website. To toggle between these configurations, update the the following line in your .env file:

To Use Locally Hosted API

REACT_APP_API=DEV

To Use Production Website's API

REACT_APP_API=PROD

@Matt-Vance
Copy link
Collaborator

I think that sounds good, thanks Tim!

@timimsms timimsms force-pushed the chore/revert-api-dev-url branch from d6c25c3 to 0ec52cc Compare April 29, 2020 08:37
@timimsms
Copy link
Contributor Author

Great @GreenWithMV! Just updated based on what we discussed. Should be ready for a review now 👍

@timimsms timimsms force-pushed the chore/revert-api-dev-url branch from e7fbfe0 to 7dabac8 Compare May 4, 2020 01:28
@timimsms
Copy link
Contributor Author

@GreenWithMV I'm going to look to revisit/merge this after the Friends PR. There's a few README updates coming in from that work so it will be good to handle this after (especially as it's very low priority).

@timimsms timimsms requested a review from Matt-Vance July 10, 2020 21:47
timimsms added 2 commits July 10, 2020 14:51
Introduces another ENV variable to specify which API URL should be utilize for the backend connection. Currently acts as a soft-override to the configuration when running locally/non-production.
@timimsms timimsms force-pushed the chore/revert-api-dev-url branch from 7dabac8 to 48d30b1 Compare July 10, 2020 21:51
@timimsms
Copy link
Contributor Author

@GreenWithMV this should be ready for review/good to merge now 👍

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

Successfully merging this pull request may close these issues.

2 participants