This commit is contained in:
Iliyan Angelov
2025-10-10 21:54:39 +03:00
parent f962401565
commit 76c857b4f5
49 changed files with 4070 additions and 1353 deletions

View File

@@ -1,9 +1,17 @@
/**
* API Configuration
* Centralized configuration for API endpoints
*
* In Development: Calls backend directly at http://localhost:8000
* In Production: Uses Next.js rewrites/nginx proxy at /api (internal network only)
*/
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000';
// Production: Use relative URLs (nginx proxy)
// Development: Use full backend URL
const isProduction = process.env.NODE_ENV === 'production';
export const API_BASE_URL = isProduction
? '' // Use relative URLs in production (proxied by nginx)
: (process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000');
export const API_CONFIG = {
// Django API Base URL