Now accessing a page by url works

This commit is contained in:
Itay Mizeretz 2017-09-24 20:12:43 +03:00
parent 6e1cc8ccf5
commit 1e254b9409
1 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,11 @@ __author__ = 'Barak'
def serve_static_file(static_path):
if static_path.startswith('api/'):
raise NotFound()
try:
return send_from_directory('ui/dist', static_path)
except NotFound:
# Because react uses various urls for same index page, this is probably the user's intention.
serve_home()
def serve_home():