feat: Add proxy to frontend dev server to fix CORS issues

This commit is contained in:
Deroino
2025-11-13 04:11:58 +08:00
parent 756dcd9126
commit e003383d65
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -19,7 +19,14 @@ export default defineConfig({
},
server: {
port: 5173,
open: true
open: true,
proxy: {
'/api': {
target: 'http://localhost:5409',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
build: {
outDir: 'dist',