From 3c161f25b097d651010b807788604c9e916b9bdf Mon Sep 17 00:00:00 2001 From: Quentin Guillemin Date: Wed, 18 Oct 2023 12:23:09 +0200 Subject: [PATCH] refactor: dynamic proxy base url --- vite.config.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vite.config.js b/vite.config.js index db8bcc272..59784ce65 100644 --- a/vite.config.js +++ b/vite.config.js @@ -34,14 +34,14 @@ export default ({ mode }) => { server: { port: 3000, proxy: { - '/publisher/api': process.env.VITE_PROXY_URL, - '/publisher/management': process.env.VITE_PROXY_URL, - '/publisher/api-docs': process.env.VITE_PROXY_URL, - '/publisher/published': process.env.VITE_PROXY_URL, - '/publisher/feed': process.env.VITE_PROXY_URL, - '/publisher/app': process.env.VITE_PROXY_URL, - '/publisher/files': process.env.VITE_PROXY_URL, - '/publisher/view': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/api': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/management': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/api-docs': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/published': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/feed': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/app': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/files': process.env.VITE_PROXY_URL, + '^(?:/[^/]*)?/view': process.env.VITE_PROXY_URL, }, }, });