ruv commited on
Commit
404b810
·
verified ·
1 Parent(s): 8e31f58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -1,9 +1,6 @@
1
- import os
2
  from flask import Flask, jsonify, send_from_directory
3
- from flask_cors import CORS
4
 
5
- app = Flask(__name__, static_folder='public', static_url_path='')
6
- CORS(app)
7
 
8
  @app.route('/api/data')
9
  def get_data():
@@ -20,11 +17,7 @@ def get_data():
20
 
21
  @app.route('/')
22
  def serve_index():
23
- return send_from_directory('public', 'index.html')
24
-
25
- @app.route('/static/js/<path:path>')
26
- def serve_static_js(path):
27
- return send_from_directory('public/static/js', path)
28
 
29
  if __name__ == "__main__":
30
  app.run(host="0.0.0.0", port=7860)
 
 
1
  from flask import Flask, jsonify, send_from_directory
 
2
 
3
+ app = Flask(__name__, static_folder='build', static_url_path='')
 
4
 
5
  @app.route('/api/data')
6
  def get_data():
 
17
 
18
  @app.route('/')
19
  def serve_index():
20
+ return send_from_directory(app.static_folder, 'index.html')
 
 
 
 
21
 
22
  if __name__ == "__main__":
23
  app.run(host="0.0.0.0", port=7860)