From 12c1a0012f380679f3ae7df0e178ffbed0daa018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 12 Jul 2021 18:13:42 +0200 Subject: [PATCH] Proxify API requests in Vue's devServer --- frontend/public/config.json | 2 +- frontend/vue.config.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/public/config.json b/frontend/public/config.json index ba4206b4b..36a1f84be 100644 --- a/frontend/public/config.json +++ b/frontend/public/config.json @@ -1,3 +1,3 @@ { - "API_BASE_URL": "http://localhost:8000/api/v2" + "API_BASE_URL": "/api/v2/" } diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 2ae460b7a..dac3abd47 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -1,4 +1,11 @@ module.exports = { + devServer: { + proxy: { + '/api': { + target: 'http://localhost:8000/' + } + } + }, transpileDependencies: [ 'vuetify' ]