first commit
This commit is contained in:
23
api/urls.py
Normal file
23
api/urls.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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'),
|
||||
]
|
||||
Reference in New Issue
Block a user