Conversation
There was a problem hiding this comment.
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.