mod: 修改接口的启动方式

This commit is contained in:
plf
2026-05-02 14:51:41 +08:00
parent d581ee1e7a
commit 9505257135
2 changed files with 5 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import uvicorn
from fastapi import FastAPI
app = FastAPI(title="CI/CD Demo", version="1.0.5")
@@ -13,3 +14,6 @@ def health():
@app.get("/items/{item_id}")
def get_item(item_id: int):
return {"item_id": item_id, "name": f"Item {item_id}"}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)