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

Reference API URL from Environment Variables in Recycle.js #236

Closed
lugenx opened this issue Aug 28, 2023 · 0 comments · Fixed by #238
Closed

Reference API URL from Environment Variables in Recycle.js #236

lugenx opened this issue Aug 28, 2023 · 0 comments · Fixed by #238
Labels
front-end front-end related issue good first issue Good for newcomers

Comments

@lugenx
Copy link
Owner

lugenx commented Aug 28, 2023

In our ecohabit/client/src/components/Recycle.js file, we currently have the API URL hardcoded. For better maintainability and flexibility, we'd like to reference this URL from our environment variables.

Task:

  1. Locate the Recycle.js file in ecohabit/client/src/components/.
  2. Find the hardcoded URL: https://api.ecohabit.org/recyclingcenters/country/${country}/postal/${postal}.
  3. Replace the hardcoded domain part of the URL (https://api.ecohabit.org) with process.env.REACT_APP_API_URL.
  4. Ensure that the final API call looks something like this:
`${process.env.REACT_APP_API_URL}/recyclingcenters/country/${country}/postal/${postal}`
  1. Create a pull request with your changes. Please ensure that the only modification is the URL update.

Tips:

  • Make sure you have set up your local environment correctly and have the .env file configured based on .env.example.
  • After making the change, test locally to ensure the app still fetches data as expected with the environment-based URL.
@lugenx lugenx added good first issue Good for newcomers front-end front-end related issue labels Aug 28, 2023
lugenx added a commit that referenced this issue Sep 6, 2023
Reference API URL from Environment Variables in Recycle.js Fixes #236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end front-end related issue good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant