Refactor healthcheck

This commit is contained in:
2022-02-12 13:38:36 +03:00
parent d93c16ffe8
commit 6b004002f1
3 changed files with 9 additions and 6 deletions

View File

@@ -35,6 +35,11 @@ async def get_filename(book_id: int, file_type: str):
return _get_filename(book.remote_id, book, file_type)
@router.get("/healthcheck")
healthcheck_router = APIRouter(
tags=["healthcheck"]
)
@healthcheck_router.get("/healthcheck")
async def healthcheck():
return "Ok!"

View File

@@ -2,13 +2,14 @@ from fastapi import FastAPI
from prometheus_fastapi_instrumentator import Instrumentator
from app.views import router
from app.views import router, healthcheck_router
def start_app() -> FastAPI:
app = FastAPI()
app.include_router(router)
app.include_router(healthcheck_router)
Instrumentator().instrument(app).expose(app, include_in_schema=True)