Add Vite proxy for API requests to backend during development

Proxy /api/* to http://localhost:8080 so dev frontend can call backend API.
This commit is contained in:
Christoph Haas 2026-03-23 22:03:24 +01:00
parent 88c870ab3c
commit 516efcebd7

View file

@ -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
}
}
}
});