Skip to content

Commit

Permalink
♻️ simplify example
Browse files Browse the repository at this point in the history
  • Loading branch information
mraniki committed Oct 31, 2023
1 parent 007f525 commit af2f616
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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())

0 comments on commit af2f616

Please sign in to comment.