From af2f61653355b864bc28bc2205f05bdebc890348 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 31 Oct 2023 06:55:38 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20simplify=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/example.py | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/examples/example.py b/examples/example.py index 53a2fe45..e085c673 100644 --- a/examples/example.py +++ b/examples/example.py @@ -3,17 +3,9 @@ """ import asyncio -import sys - -import uvicorn -from fastapi import FastAPI -from loguru import logger from findmyorder import FindMyOrder -logger.remove() -logger.add(sys.stderr, level="INFO") - async def main(): """Main""" @@ -45,26 +37,5 @@ async def main(): await asyncio.sleep(7200) -app = FastAPI() - - -@app.on_event("startup") -async def start(): - """startup""" - asyncio.create_task(main()) - - -@app.get("/") -def read_root(): - """root""" - return {"FMO is online"} - - -@app.get("/health") -def health_check(): - """healthcheck""" - return {"FMO is online"} - - if __name__ == "__main__": - uvicorn.run(app, host="0.0.0.0", port=8080) + asyncio.run(main())