diff --git a/.env.example b/.env.example index 399b6bb..0a7acc6 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -# make sure that there's no trailing slash VITE_API_URL=https://api.faithfulpack.net/v2 +# You need to set FallbackResource to dist/index.html if you're using Apache (blame Vue routing) PORT=7000 diff --git a/index.js b/index.js index b0c8fe6..6e47209 100644 --- a/index.js +++ b/index.js @@ -386,8 +386,18 @@ ALL_TABS.filter((t) => t.roles === undefined) router.addRoute(missingRoute); window.apiURL = import.meta.env.VITE_API_URL; +// fix trailing slash +if (apiURL.endsWith("/")) window.apiURL = window.apiURL.slice(0, -1); + // set as global -window.settings = await axios.get(`${window.apiURL}/settings/raw`).then((res) => res.data); +window.settings = await axios + .get(`${window.apiURL}/settings/raw`) + .then((res) => res.data) + .catch((err) => { + console.error(err); + // don't completely break the webapp if settings can't be fetched + return {}; + }); const pinia = createPinia(); Vue.use(pinia); diff --git a/resources/strings/en_US.js b/resources/strings/en_US.js index a156d81..2a2b833 100644 --- a/resources/strings/en_US.js +++ b/resources/strings/en_US.js @@ -329,7 +329,7 @@ export default { }, slug: { label: "Add-on slug", - hint: "Changing this will break old links!" + hint: "Changing this will break old links!", }, reason: { title: "Update reason",