Implement relative paths for frontend API and WebSocket connections
- Created `.env.production` file to define relative paths for production deployment. - Updated frontend API and WebSocket client to use environment variables for dynamic URL handling. - Enhanced deployment scripts (`deploy-ubuntu.sh`, `start.sh`, `start.bat`) to generate `.env.production` automatically. - Added `PRODUCTION_URLS.md` for documentation on production URL configuration and troubleshooting.
This commit is contained in:
@@ -82,6 +82,14 @@ echo -e "${GREEN}✓ Файлы скопированы${NC}"
|
||||
# 4. Сборка frontend
|
||||
echo -e "${YELLOW}[4/10] Сборка frontend...${NC}"
|
||||
cd frontend
|
||||
|
||||
# Создаем .env.production для относительных путей
|
||||
cat > .env.production << 'EOF'
|
||||
# Production - используем относительные пути
|
||||
VITE_API_URL=/api
|
||||
VITE_WS_URL=
|
||||
EOF
|
||||
|
||||
sudo -u "$REAL_USER" npm install
|
||||
sudo -u "$REAL_USER" npm run build
|
||||
cd ..
|
||||
|
||||
Reference in New Issue
Block a user