netx/web/vite.config.ts
oliver 1f2e028337 fix(webcrt): install websockets and connect WS to API in Vite dev
Uvicorn had no WebSocket implementation without the websockets package, causing browser websocket_error. Also bypass flaky Vite WS proxy by targeting :8890 in local UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 17:37:32 +08:00

19 lines
433 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
proxy: {
"/v1": {
target: "http://127.0.0.1:8890",
changeOrigin: true,
ws: true,
// Keep Origin aligned with upstream for WS handshake through proxy.
rewriteWsOrigin: true,
},
},
},
})