Update: перенастройка сайта что бы открывать 1 порт на сайт

This commit is contained in:
2026-02-11 15:46:19 +05:00
parent 65a9143bd0
commit 62340e4406
25 changed files with 1393 additions and 1216 deletions

View File

@@ -7,6 +7,7 @@ const __dirname = path.dirname(__filename);
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
const strapiTarget = env.VITE_STRAPI_PROXY_TARGET || 'http://localhost:1337';
return {
define: {
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
@@ -17,14 +18,15 @@ export default defineConfig(({ mode }) => {
'@': path.resolve(__dirname, '.'),
},
},
// --- ДОБАВЬ ЭТОТ БЛОК ---
server: {
host: '0.0.0.0', // Чтобы слушал все интерфейсы
port: 5173, // Твой порт
allowedHosts: ['iieasy.ru',
'n8n.iieasy.ru'
], // Разрешаем твой домен
host: '0.0.0.0',
port: 5173,
allowedHosts: ['iieasy.ru', 'n8n.iieasy.ru'],
// Прокси к Strapi: в dev запросы на /api и /uploads идут на Strapi без CORS и без хардкода IP
proxy: {
'/api': { target: strapiTarget, changeOrigin: true },
'/uploads': { target: strapiTarget, changeOrigin: true },
},
},
// ------------------------
};
});