mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Add healthcheck
This commit is contained in:
@@ -2,6 +2,7 @@ from app.views.author import author_router, translator_router
|
||||
from app.views.author_annotation import author_annotation_router
|
||||
from app.views.book import book_router
|
||||
from app.views.book_annotation import book_annotation_router
|
||||
from app.views.healthcheck import healtcheck_router
|
||||
from app.views.sequence import sequence_router
|
||||
from app.views.source import source_router
|
||||
from app.views.translation import translation_router
|
||||
@@ -16,4 +17,5 @@ routers = [
|
||||
book_annotation_router,
|
||||
translation_router,
|
||||
sequence_router,
|
||||
healtcheck_router,
|
||||
]
|
||||
|
||||
15
fastapi_book_server/app/views/healthcheck.py
Normal file
15
fastapi_book_server/app/views/healthcheck.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from app.depends import check_token
|
||||
|
||||
|
||||
healtcheck_router = APIRouter(
|
||||
prefix="/api/v1",
|
||||
tags=["healthcheck"],
|
||||
dependencies=[Depends(check_token)],
|
||||
)
|
||||
|
||||
|
||||
@healtcheck_router.get("/healthcheck")
|
||||
async def healthcheck():
|
||||
return "Ok!"
|
||||
Reference in New Issue
Block a user