feat: 开发测试接口
This commit is contained in:
15
app/main.py
Normal file
15
app/main.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI(title="CI/CD Demo", version="1.0.0")
|
||||
|
||||
@app.get("/")
|
||||
def root():
|
||||
return {"status": "ok", "version": "1.0.0"}
|
||||
|
||||
@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}"}
|
||||
Reference in New Issue
Block a user