imetting_frontend/vite.config.js

22 lines
657 B
JavaScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: true, // Optional: Allows the server to be accessible externally
allowedHosts: ['dev.imeeting.unisspace.com'], // Add the problematic hostname here
proxy: {
'/api': {
target: 'http://localhost:8000', // 后端服务地址
changeOrigin: true, // 是否改变请求的源头
},
'/uploads': {
target: 'http://localhost:8000', // 后端服务地址
changeOrigin: true, // 是否改变请求的源头
},
},
}
})