You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
jsamis/vite.config.js

31 lines
1.1 KiB

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: "0.0.0.0",
proxy: {
'/api': {
// target: "https://app.uair.cc/api",// 目标地址
// target: `http://10.10.10.168:8080`,// sar目标地址
target: `http://10.10.10.200/api/`,// 测试服务器址
// target: "http://10.10.10.146:9309",// Rock目标地址
// target: `http://togy.top:18080/api/`,// sar目标地址
ws: true,// 开始ws代理
changeOrigin: true, // 开发模式
rewrite: (path) => path.replace(/^\/api/, "")
},
'/statics': {
// target: "https://app.uair.cc/api",// 目标地址
target: `http://10.10.10.168:9300`,// sar目标地址
// target: `http://10.10.10.200/api/`,// 测试服务器址
// target: "http://10.10.10.146:9309",// Rock目标地址
// target: `http://togy.top:18080/api/`,// sar目标地址
ws: true,// 开始ws代理
changeOrigin: true, // 开发模式
},
}
},
})