Skip to content

Consolidate API root to /api/ path, remove duplicate endpoint at / - #5

Merged
pmca31 merged 4 commits into
build-octofit-appfrom
copilot/sub-pr-2-another-one
Feb 11, 2026
Merged

Consolidate API root to /api/ path, remove duplicate endpoint at /#5
pmca31 merged 4 commits into
build-octofit-appfrom
copilot/sub-pr-2-another-one

Conversation

Copilot AI commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

The URL configuration served two API roots: a custom api_root_codespace at / with hardcoded URLs, and the DefaultRouter's root at /api/. This contradicted all documentation and client code which exclusively use /api/.

Changes

  • Removed custom api_root_codespace function: Eliminated 30+ lines of redundant URL construction
  • Switched to SimpleRouter: Prevents automatic root view creation that would conflict with custom root
  • Moved views.api_root to /api/: Single API entry point using DRF's reverse() for environment-agnostic URLs
  • Preserved api-root named route: Maintains compatibility with existing test suite

URL Resolution

urlpatterns = [
    path('admin/', admin.site.urls),
    # Exact match for /api/ only
    path('api/', views.api_root, name='api-root'),
    # Handles /api/users/, /api/teams/, etc.
    path('api/', include(router.urls)),
]

The / path is now available for future landing page or redirect. All API operations consistently use /api/ as base.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 11, 2026 19:22
… endpoint

Co-authored-by: pmca31 <6774003+pmca31@users.noreply.github.com>
Co-authored-by: pmca31 <6774003+pmca31@users.noreply.github.com>
Co-authored-by: pmca31 <6774003+pmca31@users.noreply.github.com>
Copilot AI changed the title [WIP] Update registration validation based on review feedback Consolidate API root to /api/ path, remove duplicate endpoint at / Feb 11, 2026
Copilot AI requested a review from pmca31 February 11, 2026 19:27
@pmca31
pmca31 marked this pull request as ready for review February 11, 2026 19:47
@pmca31
pmca31 merged commit d8bc74f into build-octofit-app Feb 11, 2026
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