-
Notifications
You must be signed in to change notification settings - Fork 1
Using environment variables #1
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?
Conversation
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.
Can I suggest we use this format instead:
${import.meta.env.VITE_API_BASE}/login?useCookies=true
I leave this decision up to you, but using a template literal is
- easier to read, showing clearly how the link is constructed
- easier to extend
- avoids potential issues with new URL
Even better yet:
const apiUrl = import.meta.env.VITE_API_BASE;
{apiUrl}/login?useCookies=true
Do you have a particular concern of using the URL constructor? In fact, the reason that I opted for URL is to avoid potential issues with template literals. For example, if I use the URL constructor, then either the |
|
Sounds good. We'll stick with the URL constructor. I haven't got it to work yet but hopefully soon. |
|
The change has been made successfully throughout the site. |
What
Encapsulate the API base in the environment variables.