Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
aidpc
/
test-api
like
0
Sleeping
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
897e9ee
test-api
/
app.py
aidpc
Create app.py
c13d1c7
verified
about 2 months ago
raw
Copy download link
history
blame
207 Bytes
from
fastapi
import
FastAPI
from
pydantic
import
BaseModel
app=FastAPI()
class
Input
(
BaseModel
):
name:
str
@app.post(
"/hello"
)
def
say_hello
(
data: Input
):
return
{
"message"
:
f"Hello
{data.name}
!"
}