Skip to content

Conversation

Copy link

Copilot AI commented Oct 28, 2025

All API routes now serve under /api prefix for consistent namespacing.

Changes

  • Main application (apps/api/src/main.ts)

    • Set app.setGlobalPrefix("api") to prefix all controller routes
    • Moved Swagger UI from /api/api-docs to avoid path collision
  • E2E tests (apps/api/src/users/__tests__/user.controller.e2e-spec.ts)

    • Updated endpoint paths: /users/api/users

Routing structure

Before:
  /users           → UsersController
  /health          → HealthController
  /api/auth/*      → Better Auth (middleware)
  /api             → Swagger UI

After:
  /api/users       → UsersController
  /api/health      → HealthController
  /api/auth/*      → Better Auth (unchanged, direct Express mount)
  /api-docs        → Swagger UI

Better Auth routes unchanged—middleware mounts directly on Express at /api/auth, bypassing NestJS global prefix.

Original prompt

We need to adjust the API app so the whole app is accessible at /api prefix


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: k1eu <32620457+k1eu@users.noreply.github.com>
Copilot AI changed the title [WIP] Adjust API app to use /api prefix Add /api global prefix to all NestJS routes Oct 28, 2025
Copilot AI requested a review from k1eu October 28, 2025 18:26
Copilot finished work on behalf of k1eu October 28, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants