square_fastapi / app.py
stpete2's picture
Rename square/app.py to app.py
e29c3c1 verified
raw
history blame contribute delete
219 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class InputData(BaseModel):
x: float
@app.post("/square")
def double_number(data: InputData):
return {"result": data.x * data.x}