fastapi-master/docs_src/metadata/tutorial002.py

9 lines
154 B
Python
Raw Normal View History

2024-08-24 12:41:47 +08:00
from fastapi import FastAPI
app = FastAPI(openapi_url="/api/v1/openapi.json")
@app.get("/items/")
async def read_items():
return [{"name": "Foo"}]