visualknowledge 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server.py +11 -1
package/package.json
CHANGED
package/server.py
CHANGED
|
@@ -51,14 +51,24 @@ graph TD
|
|
|
51
51
|
- 最后给出总结要点"""
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
FRONTEND_DIR = os.path.join(BASE_DIR, 'frontend')
|
|
55
|
+
|
|
54
56
|
@app.route('/')
|
|
55
57
|
def index():
|
|
56
|
-
resp = send_from_directory(
|
|
58
|
+
resp = send_from_directory(FRONTEND_DIR, 'index.html')
|
|
57
59
|
resp.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
|
|
58
60
|
resp.headers['Pragma'] = 'no-cache'
|
|
59
61
|
resp.headers['Expires'] = '0'
|
|
60
62
|
return resp
|
|
61
63
|
|
|
64
|
+
@app.route('/<path:path>')
|
|
65
|
+
def static_files(path):
|
|
66
|
+
"""Serve all static files (CSS, JS) from the frontend directory."""
|
|
67
|
+
file_path = os.path.join(FRONTEND_DIR, path)
|
|
68
|
+
if os.path.isfile(file_path):
|
|
69
|
+
return send_from_directory(FRONTEND_DIR, path)
|
|
70
|
+
return ('Not found', 404)
|
|
71
|
+
|
|
62
72
|
|
|
63
73
|
@app.route('/api/models', methods=['GET'])
|
|
64
74
|
def get_models():
|