mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2025-09-11 22:30:41 +03:00
add healthcheck url
This commit is contained in:
parent
4a5dfbff3a
commit
4d065aa93f
0
app/api/__init__.py
Normal file
0
app/api/__init__.py
Normal file
0
app/api/system/__init__.py
Normal file
0
app/api/system/__init__.py
Normal file
15
app/api/system/controllers.py
Normal file
15
app/api/system/controllers.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from fastapi import APIRouter
|
||||||
|
from fastapi.responses import ORJSONResponse
|
||||||
|
from starlette import status
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
|
||||||
|
@router.get(
|
||||||
|
"/healthcheck",
|
||||||
|
name="system:healthcheck",
|
||||||
|
status_code=status.HTTP_200_OK,
|
||||||
|
summary="Healthcheck service",
|
||||||
|
)
|
||||||
|
async def healthcheck() -> ORJSONResponse:
|
||||||
|
return ORJSONResponse(content=None, status_code=status.HTTP_200_OK)
|
@ -11,8 +11,8 @@ class Application:
|
|||||||
title='Health check bot',
|
title='Health check bot',
|
||||||
description='Bot which check all services are working',
|
description='Bot which check all services are working',
|
||||||
version='0.0.1',
|
version='0.0.1',
|
||||||
docs_url=None,
|
docs_url=f'{settings.WEBHOOK_PATH}/docs',
|
||||||
redoc_url=None,
|
redoc_url=f'{settings.WEBHOOK_PATH}/redocs',
|
||||||
openapi_url=f'{settings.WEBHOOK_PATH}/api/openapi.json',
|
openapi_url=f'{settings.WEBHOOK_PATH}/api/openapi.json',
|
||||||
default_response_class=UJSONResponse,
|
default_response_class=UJSONResponse,
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from fastapi.responses import ORJSONResponse
|
from fastapi.responses import ORJSONResponse
|
||||||
|
|
||||||
api_router = APIRouter(prefix="/api", default_response_class=ORJSONResponse)
|
from app.api.system.controllers import router as system_router
|
||||||
|
|
||||||
|
api_router = APIRouter(prefix='/api', default_response_class=ORJSONResponse)
|
||||||
|
|
||||||
|
|
||||||
|
api_router.include_router(system_router, tags=['system'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user