pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
10 lines
250 B
10 lines
250 B
from fastapi import FastAPI
|
|
|
|
app = FastAPI()
|
|
|
|
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_item(skip: int = 0, limit: int = 10):
|
|
return fake_items_db[skip : skip + limit]
|
|
|