All checks were successful
ci/woodpecker/push/test_pipeline Pipeline was successful
[+] Fastapi app init [+] Test ci pipeline
23 lines
351 B
Python
23 lines
351 B
Python
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():
|
|
uvicorn.run(app_factory, factory=True, host="0.0.0.0", port=8000)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|