diff --git a/src/main.py b/src/main.py index c951d767..0515485a 100644 --- a/src/main.py +++ b/src/main.py @@ -31,6 +31,7 @@ async def restart(): logger.info("Restarted") return {"status": "success"} + @router.get("/api/v1/stop", tags=["program"]) async def stop(): global main_process @@ -54,6 +55,15 @@ async def start(): return {"status": "success"} +@router.get("/api/v1/status", tags=["program"]) +async def status(): + global main_process + if main_process.is_alive(): + return True + else: + return False + + if VERSION != "DEV_VERSION": router.mount("/assets", StaticFiles(directory="templates/assets"), name="assets") templates = Jinja2Templates(directory="templates")