bitterapricot commited on
Commit
ba1bdb9
·
1 Parent(s): 7a86764

fix error.

Browse files
Files changed (1) hide show
  1. fastapi/app.py +2 -2
fastapi/app.py CHANGED
@@ -11,8 +11,8 @@ def hello_json():
11
  return {"msg": "/hello/ : Hello, FastAPI Node World!"}
12
 
13
  # 带参数的路由
14
- @app.route("/hi/<name>")
15
- @app.route("/hi") # 兼容无参数情况
16
  def hi_page(name=None):
17
  if name is None:
18
  name = "访客"
 
11
  return {"msg": "/hello/ : Hello, FastAPI Node World!"}
12
 
13
  # 带参数的路由
14
+ @app.get("/hi/<name>/")
15
+ @app.get("/hi/") # 兼容无参数情况
16
  def hi_page(name=None):
17
  if name is None:
18
  name = "访客"