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:

  1. Include full paths in constants (e.g., http://localhost:3001/ai-api)
  2. Base URLs only, code appends paths as needed
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation