update:开发前端时,将api开头的路径转发到8002端口

This commit is contained in:
hrz
2025-02-16 00:17:07 +08:00
parent f4f6eb763e
commit 0bdc205497
+15 -2
View File
@@ -1,7 +1,20 @@
import { defineConfig } from 'vite'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [vue()],
server: {
open: true, // 自动启动浏览器
host: "0.0.0.0", // localhost
port: 8001, // 端口号
https: false,
hmr: {overlay: false},
proxy: {
"^/(api)": {
target: "http://127.0.0.1:8002",
changeOrigin: true
}
}
}
})