feat: add backend
This commit is contained in:
18
backend/modules/example.py
Normal file
18
backend/modules/example.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter(prefix="/example", tags=["example"])
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def list_items():
|
||||
return {"items": ["a", "b", "c"]}
|
||||
|
||||
|
||||
@router.get("/{item_id}")
|
||||
async def get_item(item_id: int):
|
||||
return {"id": item_id, "name": f"item_{item_id}"}
|
||||
|
||||
|
||||
@router.post("/")
|
||||
async def create_item():
|
||||
return {"status": "created"}
|
||||
Reference in New Issue
Block a user