From 359f08c0218615d3c00e50ce902e6b091491c606 Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 4 Nov 2022 13:05:14 +0100 Subject: [PATCH] Created /check for UptimeRobot pinger --- api_avatars.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api_avatars.py b/api_avatars.py index 46051ad..e4014c1 100644 --- a/api_avatars.py +++ b/api_avatars.py @@ -1,11 +1,15 @@ from os import path, sep from fastapi import FastAPI, HTTPException -from fastapi.responses import FileResponse +from fastapi.responses import FileResponse, JSONResponse from starlette.status import HTTP_404_NOT_FOUND from modules.utils import configGet app = FastAPI(title="HoloUA Avatars API", docs_url=None, redoc_url=None, version="1.0") +@app.get("/check", response_class=JSONResponse, include_in_schema=False) +async def check(): + return JSONResponse({"detail": "I'm alright, thank you"}) + @app.get("/", response_class=FileResponse, include_in_schema=False) async def favicon(avatar_id: str): if path.exists(f'{configGet("cache", "locations")}{sep}avatars{sep}{avatar_id}'):