diff options
author | Zero~Informatique | 2020-01-29 02:39:04 +0100 |
---|---|---|
committer | Notkea | 2020-01-29 21:59:12 +0100 |
commit | 084c509fad0fdf2415587e0e3af8e86fd306447a (patch) | |
tree | c6453af835e50c3c62797ea2954f76523fad4a2a /viewer | |
parent | c20b3cc7d8956b581c4da164e041589b6dcd1eb8 (diff) | |
download | ldgallery-084c509fad0fdf2415587e0e3af8e86fd306447a.tar.gz |
viewer: fix for the developper server when URLs with parameters are used (timestamps)
Diffstat (limited to 'viewer')
-rw-r--r-- | viewer/vue.config.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 614f975..55cd2e7 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js | |||
@@ -33,8 +33,11 @@ module.exports = { | |||
33 | before: (app, server, compiler) => { | 33 | before: (app, server, compiler) => { |
34 | app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { | 34 | app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { |
35 | const fs = require("fs"); | 35 | const fs = require("fs"); |
36 | const fileName = `${process.env.VUE_APP_EXAMPLE_PROJECT}${req.url.slice(process.env.VUE_APP_DATA_URL.length)}`; | 36 | const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); |
37 | const file = fs.readFileSync(decodeURIComponent(fileName)); | 37 | const paramIdx = url.indexOf('?'); |
38 | const filepath = paramIdx < 0 ? url : url.substring(0, paramIdx); | ||
39 | const fullpath = `${process.env.VUE_APP_EXAMPLE_PROJECT}${decodeURIComponent(filepath)}`; | ||
40 | const file = fs.readFileSync(fullpath); | ||
38 | res.end(file); | 41 | res.end(file); |
39 | }); | 42 | }); |
40 | } | 43 | } |