Files
learn-devops/docker/uv/main.py
github-actions[bot] ea0d72d879 Add uv example (#30)
Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
2024-12-23 17:33:29 +03:00

17 lines
275 B
Python

from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.post("/items/")
async def create_item(item: Item):
return item