Add healthcheck

This commit is contained in:
2022-02-05 10:26:23 +03:00
parent 42ebed5503
commit 67fc4e2e3e
6 changed files with 132 additions and 5 deletions

View File

@@ -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"

View File

@@ -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: