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:
@@ -1,7 +1,8 @@
|
||||
import axios from 'axios';
|
||||
import type { Repository, RepositoryCreate, Review, ReviewStats } from '../types';
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000/api';
|
||||
// Используем относительный путь для production или env для development
|
||||
const API_BASE_URL = import.meta.env.VITE_API_URL || '/api';
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
|
||||
Reference in New Issue
Block a user