소스 검색

添加本地代理

shmily1213 3 주 전
부모
커밋
d4480f642c
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      vite.config.js

+ 8 - 1
vite.config.js

@@ -25,7 +25,14 @@ export default defineConfig(({ mode }) => ({
     }
   },
   server: {
-    port: 5174
+    port: 5174,
+    proxy: {
+      '/api': {
+        target: 'http://localhost:8080',
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/api/, '')
+      }
+    }
   },
   plugins: [
     viteCompression({