aboutsummaryrefslogtreecommitdiff
path: root/viewer
diff options
context:
space:
mode:
authorZero~Informatique2020-01-29 23:11:55 +0100
committerZero~Informatique2020-01-30 17:24:08 +0100
commit8670fb146e90f98653c776b01f29d905e5a6fe9f (patch)
tree2f75af9e06a8e7e6ee8815cc610c196240d2db11 /viewer
parent118666b4c3faeaeaf153a2ea7172764a3cbcffab (diff)
downloadldgallery-8670fb146e90f98653c776b01f29d905e5a6fe9f.tar.gz
viewer: fixed subdirectory deploiement; all paths are now relative to index.html. resolves #17
Diffstat (limited to 'viewer')
-rw-r--r--viewer/.env2
-rw-r--r--viewer/src/views/MainLayout.vue2
-rw-r--r--viewer/vue.config.js3
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 @@
1VUE_APP_I18N_LOCALE=en 1VUE_APP_I18N_LOCALE=en
2VUE_APP_I18N_FALLBACK_LOCALE=en 2VUE_APP_I18N_FALLBACK_LOCALE=en
3VUE_APP_DATA_URL=/gallery/
4VUE_APP_EXAMPLE_PROJECT=../example/out/ 3VUE_APP_EXAMPLE_PROJECT=../example/out/
4VUE_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 {
44 fetchGalleryItems() { 44 fetchGalleryItems() {
45 this.isLoading = true; 45 this.isLoading = true;
46 this.$galleryStore 46 this.$galleryStore
47 .fetchGalleryItems(`${process.env.VUE_APP_DATA_URL}/index.json`) 47 .fetchGalleryItems(`${process.env.VUE_APP_DATA_URL}index.json`)
48 .finally(() => (this.isLoading = false)) 48 .finally(() => (this.isLoading = false))
49 .catch(this.displayError); 49 .catch(this.displayError);
50 } 50 }
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 @@
18*/ 18*/
19 19
20module.exports = { 20module.exports = {
21 publicPath: "./",
21 pluginOptions: { 22 pluginOptions: {
22 i18n: { 23 i18n: {
23 locale: "en", 24 locale: "en",
@@ -31,7 +32,7 @@ module.exports = {
31 port: 8085, 32 port: 8085,
32 serveIndex: true, 33 serveIndex: true,
33 before: (app, server, compiler) => { 34 before: (app, server, compiler) => {
34 app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { 35 app.get(`/${process.env.VUE_APP_DATA_URL}*`, (req, res) => {
35 const fs = require("fs"); 36 const fs = require("fs");
36 const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); 37 const url = req.url.slice(process.env.VUE_APP_DATA_URL.length);
37 const paramIdx = url.indexOf('?'); 38 const paramIdx = url.indexOf('?');