imetting_frontend/vite.config.js

23 lines
706 B
JavaScript
Raw Normal View History

2025-08-05 01:44:28 +00:00
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
port: 5173, // Optional: Specify a port if needed
2025-08-26 13:59:15 +00:00
allowedHosts: ['6fc3f0b0.r3.cpolar.cn'], // Add the problematic hostname here
proxy: {
'/api': {
target: 'http://localhost:8000', // 后端服务地址
changeOrigin: true, // 是否改变请求的源头
},
'/uploads': {
target: 'http://localhost:8000', // 后端服务地址
changeOrigin: true, // 是否改变请求的源头
},
},
}
2025-08-05 01:44:28 +00:00
})