mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2024-10-14 01:37:15 +00:00
add connection test api view
This commit is contained in:
parent
46622d9ab2
commit
9ab6955125
@ -6,6 +6,7 @@ from api.views import (
|
||||
DownloadApiListView,
|
||||
DownloadApiView,
|
||||
LoginApiView,
|
||||
PingView,
|
||||
PlaylistApiView,
|
||||
VideoApiListView,
|
||||
VideoApiView,
|
||||
@ -14,6 +15,7 @@ from api.views import (
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path("ping/", PingView.as_view(), name="ping"),
|
||||
path("login/", LoginApiView.as_view(), name="api-login"),
|
||||
path(
|
||||
"video/",
|
||||
|
@ -263,6 +263,18 @@ class DownloadApiListView(ApiBaseView):
|
||||
return Response(data)
|
||||
|
||||
|
||||
class PingView(ApiBaseView):
|
||||
"""resolves to /api/ping/
|
||||
GET: test your connection
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def get(request):
|
||||
"""get pong"""
|
||||
data = {"pong": request.user.id}
|
||||
return Response(data)
|
||||
|
||||
|
||||
class LoginApiView(ObtainAuthToken):
|
||||
"""resolves to /api/login/
|
||||
POST: return token and username after successful login
|
||||
|
Loading…
Reference in New Issue
Block a user