How to access environment variables in app\src\views\public\public-view.vue
? I tried for example process.env.PUBLIC_URL
but got undefined
!
Hey there,
Welcome to the forum!
In Directus (and many other applications) we have seperated the frontend and the backend.
With other words, the web UI doesnt know the same things as the backend (the process that connects to your database and handles the urls).
One of those things are environment variables.
Otherwise your visitor could easily extract your database credentials (and other critical information) easily.
What do you want to know?
If you want to know the current url, you can always use window.location.