first commit

This commit is contained in:
2026-01-16 22:20:18 +03:00
commit 5d437e5e28
56 changed files with 4463 additions and 0 deletions

23
api/urls.py Normal file
View 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'),
]