初始化
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
// MES(B) 内部 API 与 SSE 直连 :8888;其余 /api 走本地兜底服务 :3001
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/api/internal': {
|
||||
target: 'http://localhost:8888',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/sse': {
|
||||
target: 'http://localhost:8888',
|
||||
changeOrigin: true,
|
||||
// SSE 长连接
|
||||
configure: (proxy) => {
|
||||
proxy.on('proxyReq', (proxyReq) => {
|
||||
proxyReq.setHeader('X-Accel-Buffering', 'no');
|
||||
});
|
||||
},
|
||||
},
|
||||
'/api': {
|
||||
target: 'http://localhost:3001',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user