change endpoint for proxy

pull/58/head
SovietSpiderCat 2025-08-14 14:03:34 +03:00
parent 1bcb15f655
commit 911bfb88d1
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
class MetricsService { class MetricsService {
constructor() { constructor() {
this.baseUrl = 'ws://localhost:3001/api/metrics-ws'; this.baseUrl = '/metrics-ws';
this.socket = null; this.socket = null;
this.subscriptions = new Map(); this.subscriptions = new Map();
this.pendingRequests = new Map(); this.pendingRequests = new Map();

View File

@ -13,6 +13,11 @@ export default defineConfig({
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/ai-api/, ''), rewrite: (path) => path.replace(/^\/ai-api/, ''),
}, },
'/metrics-ws': {
target: 'ws://localhost:3001',
ws: true,
changeOrigin: true,
},
'/api': { '/api': {
target: 'http://localhost:3000', target: 'http://localhost:3000',
ws: true, ws: true,
@ -20,7 +25,6 @@ export default defineConfig({
bypass(req, res, options) { bypass(req, res, options) {
console.log('Proxying request:', req.url); console.log('Proxying request:', req.url);
} }
} }
} }
} }