FastAPI 应用(app.py):from fastapi import FastAPI
app = FastAPI()
@app.get("/healthz")
def healthz():
return {"ok": True}
@app.get("/api/ping")
def ping():
return {"pong": True}
生产启动(Linux 示例):gunicorn -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 \
--timeout 60 --keep-alive 5 app:app
发表评论 取消回复