larxius commited on
Commit
71b0b04
·
verified ·
1 Parent(s): da5b10f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- return send_from_directory(FRONTEND_DIR, path)
35
- return send_from_directory(FRONTEND_DIR, 'index.html')
 
 
 
 
 
 
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__':