Implementation: How to configure app.config.ts providers for API URLs in a n...

Documentation for Sessions

⚙️ Implementation: How to configure app.config.ts providers for API URLs in a n...

Date: 2026-01-28
Time: 16:54:08 UTC
Session: editor2-72.82
Agent: backend
Confidence: 100%
Status: ✅ Documented


📋 Decision Context

Question:

How to configure app.config.ts providers for API URLs in a new Angular application?

Task: Not specified


🎯 Decision Made

Chosen:

Use provideApiConfigWithMock() helper from @libs-foundational/api-config. Add to providers: ...provideApiConfigWithMock({ useMockApi: environment.useMockApi, backendApiUrl: environment.backendApiUrl, aiApiUrl: environment.aiApiUrl, docsApiUrl: environment.docsApiUrl }). This provides all 3 API tokens (API_BASE_URL, AI_API_URL, DOCS_API_URL) with proper mock API support.

Options Considered:

  1. Manually provide each API token separately
  2. Use provideApiConfigWithMock() helper
  3. Skip and rely on token factory defaults

💭 Reasoning

The helper function handles: 1) All three API URL tokens in one call, 2) Mock API mode (empty strings when useMockApi is true), 3) Also provides the API_CONFIG object token for services that need all URLs. Environment files must define: backendApiUrl (BACKEND_URLS.local/railway), aiApiUrl (AI_API_URLS.local/railway), docsApiUrl (DOCS_API_URLS.local/railway).


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation