From ad1a824f275059e4f95b72f9110c3a0fb9f6c51c Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 7 Jul 2019 17:27:40 +1000 Subject: [PATCH] Fixed config and probably autojoin --- src/store/modules/config/config.store.js | 2 +- webapp.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/store/modules/config/config.store.js b/src/store/modules/config/config.store.js index a4008a38..541c74e9 100644 --- a/src/store/modules/config/config.store.js +++ b/src/store/modules/config/config.store.js @@ -13,7 +13,7 @@ export default { }, actions: { async fetchConfig({ commit }) { - const url = process.env.API_OVERRIDE || ''; + const url = window.location.origin; const { data } = await axios.get(`${url}/config`); commit('setConfig', data); return data; diff --git a/webapp.js b/webapp.js index 2b6ea1be..834ffeab 100644 --- a/webapp.js +++ b/webapp.js @@ -110,7 +110,12 @@ const app = async (orm) => { details: result, }).end(); }); - root.get('/config', (req, res) => res.send(SettingsHelper())); + root.get('/config', (req, res) => { + res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate'); + res.header('Expires', '-1'); + res.header('Pragma', 'no-cache'); + res.send(SettingsHelper()) + }); root.use('/', express.static(path.join(__dirname, 'dist'))); root.get('*', (req, res) => { console.log('Catch all');