mirror of
https://github.com/flibusta-apps/telegram_files_server.git
synced 2025-12-06 12:35:39 +01:00
Add healthcheck
This commit is contained in:
@@ -83,3 +83,13 @@ async def delete_file(file_id: int):
|
||||
|
||||
await uploaded_file.delete()
|
||||
return uploaded_file
|
||||
|
||||
|
||||
healthcheck_router = APIRouter(
|
||||
prefix="/api/v1", dependencies=[Depends(check_token)], tags=["healthcheck"]
|
||||
)
|
||||
|
||||
|
||||
@healthcheck_router.get("/healthcheck")
|
||||
async def healthcheck():
|
||||
return "Ok"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.on_start import on_start
|
||||
from app.views import router
|
||||
from app.views import router, healthcheck_router
|
||||
from core.db import database
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ def start_app() -> FastAPI:
|
||||
app.state.database = database
|
||||
|
||||
app.include_router(router)
|
||||
app.include_router(healthcheck_router)
|
||||
|
||||
@app.on_event("startup")
|
||||
async def startup() -> None:
|
||||
|
||||
Reference in New Issue
Block a user