Compare commits

..

No commits in common. "3cef08f65b4aab79c4fb0c851d24ae8fd51e9832" and "f271fb5acfdc1d7eeccaf59a0fe60cc03081aa05" have entirely different histories.

1 changed files with 23 additions and 28 deletions

View File

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