Architecture: How should API_BASE_URL tokens be structured for future-proo...
Documentation for Sessions
🏗️ Architecture: How should API_BASE_URL tokens be structured for future-proo...
Date: 2026-01-28
Time: 16:39:10 UTC
Session: editor2-72.78
Agent: architecture
Confidence: 100%
Status: ✅ Documented
📋 Decision Context
Question:
How should API_BASE_URL tokens be structured for future-proof dev/prod environment handling?
Task: Not specified
🎯 Decision Made
Chosen:
Keep separate tokens with proper documentation and smart fallbacks: 1) core-angular API_BASE_URL is a plain token that MUST be provided by app.config.ts, 2) core-properties API_BASE_URL has providedIn:'root' with a smart factory that detects localhost and warns if not explicitly provided. Removed dead code exports (API_BASE_URL_VALUE_VALUE, API_BASE_URL_PROVIDER).
Options Considered:
- Keep duplicate tokens with hardcoded values
- Consolidate to single token
- Keep separate tokens (for circular dep avoidance) with proper documentation and safe fallbacks
💭 Reasoning
The circular dependency between core-angular and core-properties requires separate tokens. The improved design: core-angular token has no default (forces explicit provider), core-properties has smart fallback that detects development vs production by hostname. Both should be provided in app.config.ts from environment.backendApiUrl for explicit control.
📁 Files Involved
- No files specified
🔗 Related
- Decision ID:
dev_1769618347326_7hpynon - Session: 72
- Workspace: editor2
Auto-generated by MCP Smart Consolidation