Skip to content

Commit 7a590e5

Browse files
committed
refactor: use relative URLs and centralize API endpoints
- Update Django URLs to serve all APIs under /api/ prefix - Change frontend to use relative URLs (empty baseURL) instead of environment-specific domains - Create centralized endpoints.ts for maintainable API URL management - Update all frontend components to use centralized endpoints - Remove all VITE_API_BASE_URL and REACT_APP_API_BASE_URL dependencies - Add helper functions for dynamic endpoints with parameters This ensures the same Docker image works in both production and sandbox environments without requiring environment-specific configuration. Fixes: - Frontend calling old domain (balancer.live.k8s.phl.io) - API calls failing after domain migration - /login and /adminportal pages not working Closes #431
1 parent b8a3619 commit 7a590e5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

server/balancer_backend/settings.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@
106106

107107
# Build database configuration
108108
db_config = {
109-
"ENGINE": os.environ.get("SQL_ENGINE", "django.db.backends.sqlite3"),
110-
"NAME": os.environ.get("SQL_DATABASE", BASE_DIR / "db.sqlite3"),
111-
"USER": os.environ.get("SQL_USER", "user"),
112-
"PASSWORD": os.environ.get("SQL_PASSWORD", "password"),
109+
"ENGINE": os.environ.get("SQL_ENGINE", "django.db.backends.sqlite3"),
110+
"NAME": os.environ.get("SQL_DATABASE", BASE_DIR / "db.sqlite3"),
111+
"USER": os.environ.get("SQL_USER", "user"),
112+
"PASSWORD": os.environ.get("SQL_PASSWORD", "password"),
113113
"HOST": SQL_HOST,
114-
"PORT": os.environ.get("SQL_PORT", "5432"),
115-
}
114+
"PORT": os.environ.get("SQL_PORT", "5432"),
115+
}
116116

117117
# Configure SSL/TLS based on connection type
118118
# CloudNativePG within cluster typically doesn't require SSL

0 commit comments

Comments
 (0)