Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
app = FastAPI() | |
async def read_root(): | |
return {"message": "Hello, World mohammad!"} | |
# from fastapi import FastAPI | |
from pydantic import BaseModel | |
# app = FastAPI() | |
# Define a Pydantic model for the request body | |
class Item(BaseModel): | |
name: str | |
description: str = None | |
price: float | |
tax: float = None | |
def create_item(item: Item): | |
return {"item": item, "message": "Hello, World mohammad!"} |