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:


💭 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


🔗 Related


Auto-generated by MCP Smart Consolidation