Files
CODE_ASSISTANT/5_django_backend/config/urls.py
T

30 lines
1.2 KiB
Python

"""최상위 URL — 프론트 VITE_API_BASE_URL(/api/v1) 아래에 매닮."""
from django.conf import settings
from django.contrib import admin
from django.http import JsonResponse
from django.urls import include, path, re_path
from apps.accounts.views import MeView
from apps.gateway import phoenix_proxy
from common.envelope import envelope
def health(_request):
return JsonResponse(
envelope(success=True, status_code=200, data={"app": settings.APP_NAME, "version": settings.APP_VERSION})
)
urlpatterns = [
path("admin/", admin.site.urls),
path("api/v1/health", health),
path("api/v1/auth/", include("apps.accounts.urls")),
path("api/v1/users/me", MeView.as_view()),
path("api/v1/chat/", include("apps.chat.urls")),
path("api/v1/admin/", include("apps.stats.urls")), # 관리자 대시보드 집계
path("api/v1/snippets", include("apps.snippets.urls")), # 공용 스니펫(PostgreSQL). 슬래시 없이 — 프론트가 /snippets 로 침
path("", include("apps.gateway.urls")), # /api/ito/* — 사내 LLM(FabriX) 중계
re_path(r"^phoenix(?:/(?P<rest>.*))?$", phoenix_proxy.proxy), # 관측 화면 — 8914 뒤에 붙임(바깥 포트가 이것뿐)
]