ytptube/app/routes/api/ping.py
2025-06-13 00:45:46 +03:00

19 lines
440 B
Python

from aiohttp import web
from aiohttp.web import Response
from app.library.DownloadQueue import DownloadQueue
from app.library.router import route
@route("GET", "api/ping/", "ping")
async def ping(queue: DownloadQueue) -> Response:
"""
Ping the server.
Returns:
Response: The response object.
"""
await queue.queue.test()
return web.json_response(data={"status": "pong"}, status=web.HTTPOk.status_code)