lanbogao commited on
Commit
c26f5ec
1 Parent(s): 08eee20

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -1
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!"})