24 lines
934 B
Python
24 lines
934 B
Python
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
from . import views
|
|
|
|
# Create a router for viewset endpoints
|
|
router = DefaultRouter()
|
|
router.register(r'prices', views.BitcoinPriceViewSet, basename='price')
|
|
router.register(r'events', views.EventsViewSet, basename='event')
|
|
|
|
urlpatterns = [
|
|
# Router URLs
|
|
path('', include(router.urls)),
|
|
|
|
# Custom view URLs (matching your Zig API structure)
|
|
path('status/', views.StatusView.as_view(), name='api-status'),
|
|
path('chart-data/', views.ChartDataView.as_view(), name='api-chart-data'),
|
|
path('stats/', views.StatsView.as_view(), name='api-stats'),
|
|
path('health/', views.HealthCheckView.as_view(), name='api-health'),
|
|
|
|
# Convenience endpoints
|
|
path('latest/', views.StatusView.as_view(), name='api-latest'),
|
|
path('recent-events/', views.EventsViewSet.as_view({'get': 'recent'}), name='api-recent-events'),
|
|
]
|