mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-07 17:34:23 +00:00
94018d167f
- Generic WebSockets (stats, exec) now connect to /ws?nodeId= instead of the bare root so the upgrade handler detects the remote node and proxies the WS connection to the correct remote Sencho instance. - Vite dev proxy gains ws:true on /api and a new /ws entry so WebSocket upgrades reach localhost:3000 during npm run dev. - Backend WS message handler falls back to the default local node when the nodeId in a proxied message doesn't exist in the local DB. - Open App button now extracts the hostname from the remote node's api_url instead of using window.location.hostname.
29 lines
587 B
TypeScript
29 lines
587 B
TypeScript
import { defineConfig } from 'vite'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
'/ws': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
})
|