Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Duplicated from
SpacesExamples/fastapi_dummy
lanbogao
/
docker_fastapi
like
0
Sleeping
App
Files
Files
Community
76f0bfc
docker_fastapi
/
main.py
lanbogao
Update main.py
11175d2
almost 2 years ago
raw
Copy download link
history
blame
Safe
240 Bytes
from
fastapi
import
FastAPI
from
fastapi.responses
import
JSONResponse
app = FastAPI()
@app.get(
"/"
)
def
read_root
():
return
{
"Hello"
:
"World!"
}
@app.get(
"/json"
)
def
read_json
():
return
JSONResponse(content={
"Hello"
:
"World!"
})