Architecture: Should API URL constants include paths like /ai-api or be ba...
Documentation for Sessions
🏗️ Architecture: Should API URL constants include paths like /ai-api or be ba...
Date: 2026-02-03
Time: 03:21:40 UTC
Session: editor2-76.87
Agent: architecture
Confidence: 90%
Status: ✅ Documented
📋 Decision Context
Question:
Should API URL constants include paths like /ai-api or be base URLs only?
Task: Session 82.5 - Environment-Aware URLs: Base URL architecture
🎯 Decision Made
Chosen:
Base URLs only, code appends paths as needed
Options Considered:
- Include full paths in constants (e.g., http://localhost:3001/ai-api)
- Base URLs only, code appends paths as needed
- Separate constants for base and full URLs
💭 Reasoning
MCP connector already appends /ai-api to base URLs at lines 47, 63, 166 in mcp-connector.js. Adding /ai-api to constant created double-path bugs (/ai-api/ai-api). Base URLs are more flexible - same base can be used for different endpoints. Matches pattern in environment.shared.ts. Prevents path duplication bugs.
📁 Files Involved
libs/libs-foundational/api-config/src/lib/api-tokens.tsapps/chrome-extension/mcp-connector.js
🔗 Related
- Decision ID:
dev_1770088898791_9oc76qj - Session: 76
- Workspace: editor2
Auto-generated by MCP Smart Consolidation