From 516efcebd7c81ce502bbf37c3085f046585f38dd Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 23 Mar 2026 22:03:24 +0100 Subject: [PATCH] Add Vite proxy for API requests to backend during development Proxy /api/* to http://localhost:8080 so dev frontend can call backend API. --- frontend/vite.config.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 70f41f8..46e1f9c 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -3,5 +3,13 @@ import tailwindcss from '@tailwindcss/vite'; import { defineConfig } from 'vite'; export default defineConfig({ - plugins: [tailwindcss(), sveltekit()] + plugins: [tailwindcss(), sveltekit()], + server: { + proxy: { + '/api': { + target: 'http://localhost:8080', + changeOrigin: true + } + } + } });