Update backend/app.py
Browse files- 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'])
|