Fix SSE route dependency and align architecture docs

This commit is contained in:
ash66
2026-05-18 16:32:42 +08:00
parent 86b9ac806a
commit 3f69cad404
149 changed files with 4786 additions and 5957 deletions

View File

@@ -1,17 +1,24 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: '0.0.0.0',
port: 5173,
proxy: {
'^/api/.*': {
target: 'http://6.86.80.8:8000',
changeOrigin: true,
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const apiHost = env.API_HOST || 'localhost'
const apiPort = env.API_PORT || '8000'
const proxyTarget = env.VITE_API_PROXY_TARGET || `http://${apiHost}:${apiPort}`
return {
plugins: [react()],
server: {
host: '0.0.0.0',
port: Number(env.FRONTEND_PORT || 5173),
proxy: {
'/api': {
target: proxyTarget,
changeOrigin: true,
},
},
},
},
}
})