From 72f5cce5e342f15c267d9119e4b778e39a0abee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Dvo=C5=99=C3=A1k?= Date: Fri, 3 Oct 2025 17:53:02 +0200 Subject: [PATCH] fef --- frontend/src/logo.js | 2 +- frontend/vite.config.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/logo.js b/frontend/src/logo.js index 81304c1..aaafd6e 100644 --- a/frontend/src/logo.js +++ b/frontend/src/logo.js @@ -2,7 +2,7 @@ import './style.css' import gsap from 'gsap' // Configuration -const API_BASE_URL = '' // Requests will be made to the same origin, and Vite will proxy /logos to the backend +const API_BASE_URL = window.location.hostname === 'localhost' ? '/api' : 'http://localhost:8080' // Get UUID from URL const urlParams = new URLSearchParams(window.location.search) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index db98819..0859caa 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -7,11 +7,10 @@ export default defineConfig({ port: 3000, open: true, proxy: { - // Proxy all /logos/* requests to the backend - '^/logos/.*': { + '/api': { target: process.env.VITE_API_URL || 'http://localhost:8080', changeOrigin: true, - secure: false + rewrite: (path) => path.replace(/^\/api/, '') } } },