2022-10-23 21:30:00 +01:00
|
|
|
from django.urls import include, path
|
2022-08-22 23:26:39 +01:00
|
|
|
from rest_framework import permissions
|
2022-10-23 21:30:00 +01:00
|
|
|
from rest_framework.schemas import get_schema_view
|
2022-08-22 23:26:39 +01:00
|
|
|
|
|
|
|
from . import views
|
|
|
|
|
|
|
|
app_name = "api"
|
|
|
|
|
2022-08-23 09:23:22 +01:00
|
|
|
api_urlpatterns = [
|
2022-10-31 20:40:58 +00:00
|
|
|
path("ping/", views.PingAPIView.as_view(), name="ping"),
|
|
|
|
path("page-links/", views.PageLinksAPIView.as_view(), name="page-links"),
|
|
|
|
path("lmotfy/", views.LMOTFYAPIView.as_view(), name="lmotfy"),
|
2024-01-28 18:06:17 +00:00
|
|
|
path("latest-posts/", views.LatestPostsAPIView.as_view(), name="latest-posts"),
|
2022-08-23 09:23:22 +01:00
|
|
|
]
|
2022-08-22 23:26:39 +01:00
|
|
|
|
|
|
|
schema_view = get_schema_view(
|
2022-10-23 21:30:00 +01:00
|
|
|
title="Website API",
|
|
|
|
version="v1",
|
|
|
|
description="Random API endpoints for cool things",
|
2022-08-22 23:26:39 +01:00
|
|
|
public=True,
|
|
|
|
permission_classes=[permissions.AllowAny],
|
|
|
|
patterns=[
|
|
|
|
# HACK: Ensure the created URLs are fully-formed
|
|
|
|
path("api/", include(api_urlpatterns))
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
urlpatterns = [
|
2022-08-23 08:39:38 +01:00
|
|
|
path(
|
2022-10-23 21:30:00 +01:00
|
|
|
"schema/",
|
|
|
|
schema_view,
|
|
|
|
name="schema",
|
2022-08-22 23:26:39 +01:00
|
|
|
),
|
2022-10-23 21:30:00 +01:00
|
|
|
path("", views.SwaggerRedirectView.as_view(), name="index"),
|
2022-08-22 23:26:39 +01:00
|
|
|
] + api_urlpatterns
|