Bugfix: Should the @Controller decorators in backend-api include 'ap...
Documentation for Sessions
🐛 Bugfix: Should the @Controller decorators in backend-api include 'ap...
Date: 2026-02-20
Time: 19:17:35 UTC
Session: gspace1-129.2
Agent: backend
Confidence: 100%
Status: ✅ Documented
📋 Decision Context
Question:
Should the @Controller decorators in backend-api include 'api/' prefix when setGlobalPrefix('api') already adds it?
Task: Fix /api/api/ double prefix bug in backend-api controllers
🎯 Decision Made
Chosen:
Removed redundant 'api/' prefix from 6 @Controller decorators + 1 code-gen template. The global prefix in main.ts already adds /api to all routes, so these were causing /api/api/ double-prefix.
Options Considered:
- No alternatives documented
💭 Reasoning
setGlobalPrefix('api') in main.ts prepends /api to every route. Controllers that also included 'api/' in their @Controller() path were producing /api/api/... routes. This made the endpoints unreachable via expected URLs (/api/...) — notably breaking the Vitto backend-api-client hierarchy call. All other ~50 controllers in the app correctly omit the api/ prefix.
📁 Files Involved
apis/backend-api/src/app/platform-users/platform-users.controller.tsapis/backend-api/src/app/spaces/space-files.controller.tsapis/backend-api/src/app/generated/generated-modules.controller.tsapis/backend-api/src/app/mocks/mock-registry.controller.tsapis/backend-api/src/app/generated/backend-module-generator.service.ts
🔗 Related
- Decision ID:
dev_1771615055354_nr3eix7 - Session: 129
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation