[Blog] Preparing
All checks were successful
ci/woodpecker/push/test_pipeline Pipeline was successful

[+] Fastapi app init
[+] Test ci pipeline
This commit is contained in:
2026-04-19 10:58:53 +03:00
parent ef797bc85b
commit ba45f40a9b
4 changed files with 34 additions and 3 deletions

18
main.py
View File

@@ -1,5 +1,21 @@
import uvicorn
from fastapi import FastAPI
from contextlib import asynccontextmanager
@asynccontextmanager
async def lifespan(app: FastAPI):
yield
def app_factory():
app = FastAPI(lifespan=lifespan)
return app
def main():
print("Hello from blog!")
uvicorn.run(app_factory, factory=True, host="0.0.0.0", port=8000)
if __name__ == "__main__":