From 8670fb146e90f98653c776b01f29d905e5a6fe9f Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Wed, 29 Jan 2020 23:11:55 +0100 Subject: viewer: fixed subdirectory deploiement; all paths are now relative to index.html. resolves #17 --- viewer/.env | 2 +- viewer/src/views/MainLayout.vue | 2 +- viewer/vue.config.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/viewer/.env b/viewer/.env index 59b220a..9092dea 100644 --- a/viewer/.env +++ b/viewer/.env @@ -1,4 +1,4 @@ VUE_APP_I18N_LOCALE=en VUE_APP_I18N_FALLBACK_LOCALE=en -VUE_APP_DATA_URL=/gallery/ VUE_APP_EXAMPLE_PROJECT=../example/out/ +VUE_APP_DATA_URL=gallery/ diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index f608b9d..cedef58 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue @@ -44,7 +44,7 @@ export default class MainLayout extends Vue { fetchGalleryItems() { this.isLoading = true; this.$galleryStore - .fetchGalleryItems(`${process.env.VUE_APP_DATA_URL}/index.json`) + .fetchGalleryItems(`${process.env.VUE_APP_DATA_URL}index.json`) .finally(() => (this.isLoading = false)) .catch(this.displayError); } diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 55cd2e7..67b7461 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -18,6 +18,7 @@ */ module.exports = { + publicPath: "./", pluginOptions: { i18n: { locale: "en", @@ -31,7 +32,7 @@ module.exports = { port: 8085, serveIndex: true, before: (app, server, compiler) => { - app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { + app.get(`/${process.env.VUE_APP_DATA_URL}*`, (req, res) => { const fs = require("fs"); const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); const paramIdx = url.indexOf('?'); -- cgit v1.2.3