mirror of
https://github.com/revanced/revanced-polling-api.git
synced 2025-04-30 14:44:27 +02:00
feat: add ping endpoint
This commit is contained in:
parent
1b10fe6e74
commit
0b45044649
@ -29,6 +29,7 @@ import app.models.GeneralErrors as GeneralErrors
|
|||||||
from app.routers import root
|
from app.routers import root
|
||||||
from app.routers import auth
|
from app.routers import auth
|
||||||
from app.routers import items
|
from app.routers import items
|
||||||
|
from app.routers import ping
|
||||||
|
|
||||||
"""Implements an API for our polling app"""
|
"""Implements an API for our polling app"""
|
||||||
|
|
||||||
@ -64,6 +65,7 @@ app.add_middleware(SlowAPIMiddleware)
|
|||||||
app.include_router(root.router)
|
app.include_router(root.router)
|
||||||
app.include_router(items.router)
|
app.include_router(items.router)
|
||||||
app.include_router(auth.router)
|
app.include_router(auth.router)
|
||||||
|
app.include_router(ping.router)
|
||||||
|
|
||||||
# Setup cache
|
# Setup cache
|
||||||
|
|
||||||
|
@ -9,4 +9,4 @@ class BallotModel(BaseModel):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
discord_id_hash: str
|
discord_id_hash: str
|
||||||
ballot: list[BallotFields]
|
ballot: str
|
||||||
|
12
app/routers/ping.py
Normal file
12
app/routers/ping.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
from fastapi import APIRouter, Request, Response
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.head('/ping', status_code=204, tags=['Ping'])
|
||||||
|
async def ping(request: Request, response: Response) -> None:
|
||||||
|
"""Check if the API is running.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
"""
|
||||||
|
return None
|
Loading…
x
Reference in New Issue
Block a user