import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

export default defineConfig({
	plugins: [sveltekit()],
	server: {
		proxy: {
			'/api': {
				target: 'http://127.0.0.1:8000',
				changeOrigin: true,
				secure: false,
				rewrite: (path) => path.replace(/^\/api/, '/api')
			},
			'/ws': {
				target: 'ws://127.0.0.1:8000',
				ws: true,
				changeOrigin: true,
				secure: false
			}
		}
	}
});
