-
Notifications
You must be signed in to change notification settings - Fork 140
Api url 2493 #2510
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
base: master
Are you sure you want to change the base?
Api url 2493 #2510
Conversation
…alue on src/api/call.js
…placment for REACT_APP_POLICYENGINE_API
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
headers: { | ||
"Content-Type": "application/json", | ||
return fetchMethod( | ||
process.env.REACT_APP_POLICYENGINE_API || |
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: Would it be more advantageous to set the POLICYENGINE_API
constant as either the env var or standard address, then use that constant in the fetch method?
This would enable other components, as needed, to import the constant
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.
Thanks for your work on this @fudgemasterultra. Apologies for the delay in review, I was unavailable last week for work-related reasons.
I left one comment. Would you mind following our README guide to creating a PR (including adding a "Fixes #ISSUE" line) and addressing my one comment? Otherwise, this will be really valuable to have.
Environment Configuration and API Setup
What Changed
.env.example
file as a template for environment configuration.env
to.gitignore
to prevent committing configuration.env.example
to.env
apiCall
function to use environment variables with a fallback URLWhy This Change
Technical Details
cp .env.example .env
command to Makefile for easy environment setupprocess.env.REACT_APP_POLICYENGINE_API || "https://api.policyengine.org"
.env
file is ignored in version control