import { defineConfig } from '@vben/vite-config'; export default defineConfig(async () => { return { application: {}, vite: { server: { proxy: { '/api': { changeOrigin: true, target: 'http://localhost:5211', ws: true, }, // 消息中心通知 Hub(SignalR 实时推送,前端铃铛) '/notifications-hub': { changeOrigin: true, target: 'http://localhost:5211', rewrite: (path) => path.replace(/^\/notifications-hub/, ''), ws: true, }, '/file-api': { changeOrigin: true, target: 'http://localhost:8090', rewrite: (path) => path.replace(/^\/file-api/, ''), }, '/im-api': { changeOrigin: true, target: 'http://localhost:5212', rewrite: (path) => path.replace(/^\/im-api/, '/api'), ws: true, }, '/im-signalr': { changeOrigin: true, target: 'http://localhost:5212', rewrite: (path) => path.replace(/^\/im-signalr/, ''), ws: true, }, '/workflow-api': { changeOrigin: true, target: 'http://localhost:5213', rewrite: (path) => path.replace(/^\/workflow-api/, ''), }, '/order-api': { changeOrigin: true, target: 'http://localhost:5214', rewrite: (path) => path.replace(/^\/order-api/, ''), }, '/sso': { // SSO 服务(OpenIddict OIDC Provider),端口 5215 changeOrigin: true, target: 'http://localhost:5215', rewrite: (path) => path.replace(/^\/sso/, ''), }, }, }, }, }; });