Update app.py
Browse files
app.py
CHANGED
|
@@ -20,9 +20,13 @@ def get_data():
|
|
| 20 |
}
|
| 21 |
return jsonify(data)
|
| 22 |
|
| 23 |
-
@app.route('/')
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
if __name__ == "__main__":
|
| 28 |
app.run(host="0.0.0.0", port=7860)
|
|
|
|
| 20 |
}
|
| 21 |
return jsonify(data)
|
| 22 |
|
| 23 |
+
@app.route('/', defaults={'path': ''})
|
| 24 |
+
@app.route('/<path:path>')
|
| 25 |
+
def serve(path):
|
| 26 |
+
if path != "" and os.path.exists(app.static_folder + '/' + path):
|
| 27 |
+
return send_from_directory(app.static_folder, path)
|
| 28 |
+
else:
|
| 29 |
+
return send_from_directory(app.static_folder, 'index.html')
|
| 30 |
|
| 31 |
if __name__ == "__main__":
|
| 32 |
app.run(host="0.0.0.0", port=7860)
|