diff --git a/src/Charts2/Components/metricsService.jsx b/src/Charts2/Components/metricsService.jsx index 90da3ed..60a58e9 100644 --- a/src/Charts2/Components/metricsService.jsx +++ b/src/Charts2/Components/metricsService.jsx @@ -1,6 +1,6 @@ class MetricsService { constructor() { - this.baseUrl = 'ws://localhost:3001/api/metrics-ws'; + this.baseUrl = '/metrics-ws'; this.socket = null; this.subscriptions = new Map(); this.pendingRequests = new Map(); diff --git a/vite.config.js b/vite.config.js index 6ad91d5..e391567 100755 --- a/vite.config.js +++ b/vite.config.js @@ -13,6 +13,11 @@ export default defineConfig({ changeOrigin: true, rewrite: (path) => path.replace(/^\/ai-api/, ''), }, + '/metrics-ws': { + target: 'ws://localhost:3001', + ws: true, + changeOrigin: true, + }, '/api': { target: 'http://localhost:3000', ws: true, @@ -20,7 +25,6 @@ export default defineConfig({ bypass(req, res, options) { console.log('Proxying request:', req.url); } - } } }