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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.py +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visualknowledge",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Interactive AI Chat with Visualization - one-click launch via npx",
5
5
  "bin": {
6
6
  "visualknowledge": "./bin/visualknowledge.js"
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(os.path.join(BASE_DIR, 'frontend'), 'index.html')
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():