You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Locate the Recycle.js file in ecohabit/client/src/components/.
Find the hardcoded URL: https://api.ecohabit.org/recyclingcenters/country/${country}/postal/${postal}.
Replace the hardcoded domain part of the URL (https://api.ecohabit.org) with process.env.REACT_APP_API_URL.
Ensure that the final API call looks something like this:
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:
Recycle.js
file inecohabit/client/src/components/
.https://api.ecohabit.org/recyclingcenters/country/${country}/postal/${postal}
.https://api.ecohabit.org
) withprocess.env.REACT_APP_API_URL
.`${process.env.REACT_APP_API_URL}/recyclingcenters/country/${country}/postal/${postal}`
Tips:
.env
file configured based on.env.example
.The text was updated successfully, but these errors were encountered: