Parcourir la source

✨ feat(server): 添加开发环境API代理配置

- 配置/mini路径代理到本地10086服务
- 启用WebSocket支持以处理实时通信
yourname il y a 4 mois
Parent
commit
b6e1a98766
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. 8 1
      vite.config.ts

+ 8 - 1
vite.config.ts

@@ -13,7 +13,14 @@ export default defineConfig({
     progressTrackingPlugin(),
   ],
   server: {
-    allowedHosts:true
+    allowedHosts:true,
+    proxy: {
+      '/mini': {
+        target: 'http://localhost:10086',
+        // changeOrigin: true,
+        ws: true
+      }
+    }
   },
   // 配置 @ 别名
   resolve: {