Files
blog.pyaqa.ru/app/main.py
Sergey Vanyushkin 2cccad2da7
Some checks failed
ci/woodpecker/pr/lints Pipeline was successful
ci/woodpecker/pr/tests Pipeline was successful
ci/woodpecker/pr/types Pipeline failed
fix: fix woodpecker pipelines
2026-04-26 14:35:54 +03:00

24 lines
434 B
Python

from contextlib import asynccontextmanager
from typing import AsyncGenerator
import uvicorn
from fastapi import FastAPI
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
yield
def app_factory() -> FastAPI:
app = FastAPI(lifespan=lifespan)
return app
def main() -> None:
uvicorn.run(app_factory, factory=True, host="0.0.0.0", port=8000)
if __name__ == "__main__":
main()