paleDriver7 commited on
Commit
3395f93
·
verified ·
1 Parent(s): 686cfdc

Update backend/app.py

Browse files
Files changed (1) hide show
  1. backend/app.py +5 -0
backend/app.py CHANGED
@@ -38,6 +38,11 @@ def serve_static(filename):
38
  def index(subpath=None):
39
  return send_from_directory(app.static_folder, 'index.html')
40
 
 
 
 
 
 
41
 
42
 
43
  @app.route('/chat', methods=['POST'])
 
38
  def index(subpath=None):
39
  return send_from_directory(app.static_folder, 'index.html')
40
 
41
+ #确保任何未知的路径都返回 index.html
42
+ @app.route('/<path:path>', methods=['GET'])
43
+ def catch_all(path):
44
+ return send_from_directory(app.static_folder, 'index.html')
45
+
46
 
47
 
48
  @app.route('/chat', methods=['POST'])