mirror of
https://github.com/zonemaster/zonemaster-gui.git
synced 2026-01-19 12:34:13 +01:00
In order to support use cases where the GUI is served from a non-root base URL (i.e. https://zonemaster.example/some/subdirectory instead of https://zonemaster.example), some modifications were necessary to some Astro and Svelte files in the project. I initially tried to keep my modifications to the Apache configuration files without touching anything else, but I quickly realized that it couldn’t be done by editing Apache configuration files alone. That is because the build process assumes that the site is served from a base directory of / and all HTML files have baked-in absolute URLs. Fortunately, astro.config.mjs allows setting a base path that can be easily referred to from Astro and Svelte files. Setting it fixed *almost* everything: CSS and JS assets load from the right place, but favicons did not and some link target URLs needed manual adjustment in order to include the base directory. I am not familiar with these technologies and there might be a better approach to some of the edits I’ve made to Astro and Svelte files. So instead of having to edit the Apache configuration file, one needs to edit that file and config.ts in order to set the base URL to a non-default value. This seems to me like an acceptable compromise.
3 lines
71 B
Text
3 lines
71 B
Text
PUBLIC_BASE_URL="/"
|
|
PUBLIC_API_URL="/api"
|
|
PUBLIC_POLLING_INTERVAL=5000
|