mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-06 02:26:46 +00:00
13 lines
276 B
Python
13 lines
276 B
Python
from fastapi import APIRouter
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/")
|
|
async def read_items():
|
|
return [{"name": "Item Foo"}, {"name": "item Bar"}]
|
|
|
|
|
|
@router.get("/{item_id}")
|
|
async def read_item(item_id: str):
|
|
return {"name": "Fake Specific Item", "item_id": item_id}
|