From 94095288b785d6d86413e64a85a1442628946bed Mon Sep 17 00:00:00 2001 From: profitroll Date: Tue, 17 Jan 2023 10:54:12 +0100 Subject: [PATCH] API status check implemented --- sync_api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sync_api.py b/sync_api.py index 9a65c4a..4ddafee 100644 --- a/sync_api.py +++ b/sync_api.py @@ -2,7 +2,8 @@ from os import makedirs, path from modules.app import app from modules.utils import configGet from modules.extensions_loader import dynamic_import_from_src -from fastapi.responses import FileResponse +from fastapi.responses import FileResponse, Response +from starlette.status import HTTP_200_OK makedirs(configGet("data", "locations"), exist_ok=True) @@ -15,6 +16,10 @@ for entry in [path.join(configGet("data", "locations"), "api_keys.json"), path.j pass +@app.get("/check", response_class=Response, include_in_schema=False) +async def check(): + return Response(HTTP_200_OK) + @app.get("/favicon.ico", response_class=FileResponse, include_in_schema=False) async def favicon(): return FileResponse("favicon.ico")