Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
2 |
|
3 |
app = FastAPI()
|
4 |
|
5 |
@app.get("/")
|
6 |
def read_root():
|
7 |
-
return {"Hello": "World!"}
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
from fastapi.responses import JSONResponse
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
@app.get("/")
|
7 |
def read_root():
|
8 |
+
return {"Hello": "World!"}
|
9 |
+
|
10 |
+
|
11 |
+
@app.get("/json")
|
12 |
+
def read_root():
|
13 |
+
return JSONResponse(content={"Hello": "World!"})
|