1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
from fastapi import APIRouter from models.bid import Bid from typing import List router = APIRouter() fake_bid_store: List[Bid] = [] @router.get("/", response_model=List[Bid]) def get_bids(): return fake_bid_store @router.post("/", response_model=Bid) def submit_bid(bid: Bid): fake_bid_store.append(bid) return bid