20 lines
427 B
Python
20 lines
427 B
Python
import uvicorn
|
|
from fastapi import FastAPI
|
|
|
|
app = FastAPI(title="CI/CD Demo", version="1.0.5")
|
|
|
|
@app.get("/")
|
|
def root():
|
|
return {"status": "ok", "version": "1.0.5"}
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {"healthy": True}
|
|
|
|
@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)
|