rc #62

Merged
deployer3000 merged 3 commits from rc into main 2025-09-01 16:46:39 +03:00
1 changed files with 28 additions and 23 deletions

View File

@ -1,30 +1,35 @@
import { defineConfig } from 'vite' import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr' import svgr from 'vite-plugin-svgr'
export default defineConfig({ export default defineConfig(({ mode }) => {
plugins: [react(), svgr()], // Загружаем переменные окружения
server: { const env = loadEnv(mode, process.cwd())
host: true,
allowedHosts: ['dev.msf.enode', 'demo-msf.kis-npo.ru'], return {
proxy: { plugins: [react(), svgr()],
'/ai-api': { server: {
target: 'http://192.168.2.39:5134', host: true,
changeOrigin: true, allowedHosts: ['dev.msf.enode', 'demo-msf.kis-npo.ru'],
rewrite: (path) => path.replace(/^\/ai-api/, ''), proxy: {
}, '/ai-api': {
'/metrics-ws': { target: env.VITE_AI_API_URL || 'http://192.168.2.39:5134',
target: 'ws://192.168.2.39:3001', changeOrigin: true,
ws: true, rewrite: (path) => path.replace(/^\/ai-api/, ''),
changeOrigin: true, },
}, '/metrics-ws': {
'/api': { target: env.VITE_WS_URL || 'ws://192.168.2.39:3001',
target: 'http://192.168.2.39:3000', ws: true,
changeOrigin: true, changeOrigin: true,
bypass(req, res, options) { },
console.log('Proxying request:', req.url); '/api': {
target: env.VITE_API_URL || 'http://192.168.2.39:3000',
changeOrigin: true,
bypass(req, res, options) {
console.log('Proxying request:', req.url);
}
} }
} }
} }
} }
}); })