20 lines
422 B
JavaScript
20 lines
422 B
JavaScript
import { defineConfig } from "vite";
|
||
import vue from "@vitejs/plugin-vue";
|
||
|
||
export default defineConfig({
|
||
plugins: [vue()],
|
||
server: {
|
||
host: true,
|
||
port: 5173,
|
||
proxy: {
|
||
// HTTP API:/api/... → http://localhost:8080/api/...
|
||
"/api": {
|
||
target: "http://localhost:8080",
|
||
changeOrigin: true,
|
||
// WebSocket 升级(ws:// / wss://)
|
||
ws: true,
|
||
},
|
||
},
|
||
},
|
||
});
|