Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,8 +31,14 @@ def serve_react(path):
|
|
| 31 |
if path.startswith('api/') or path.startswith('socket.io'):
|
| 32 |
abort(404)
|
| 33 |
if path and os.path.exists(os.path.join(FRONTEND_DIR, path)):
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
if __name__ == '__main__':
|
|
|
|
| 31 |
if path.startswith('api/') or path.startswith('socket.io'):
|
| 32 |
abort(404)
|
| 33 |
if path and os.path.exists(os.path.join(FRONTEND_DIR, path)):
|
| 34 |
+
res = send_from_directory(FRONTEND_DIR, path)
|
| 35 |
+
else:
|
| 36 |
+
res = send_from_directory(FRONTEND_DIR, 'index.html')
|
| 37 |
+
|
| 38 |
+
res.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
|
| 39 |
+
res.headers['Pragma'] = 'no-cache'
|
| 40 |
+
res.headers['Expires'] = '0'
|
| 41 |
+
return res
|
| 42 |
|
| 43 |
|
| 44 |
if __name__ == '__main__':
|