From 1e254b94090ab21e167d9737e8a576f4238b8685 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Sun, 24 Sep 2017 20:12:43 +0300 Subject: [PATCH] Now accessing a page by url works --- monkey_island/cc/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey_island/cc/app.py b/monkey_island/cc/app.py index c62c2a6c3..4a83390b1 100644 --- a/monkey_island/cc/app.py +++ b/monkey_island/cc/app.py @@ -25,7 +25,11 @@ __author__ = 'Barak' def serve_static_file(static_path): if static_path.startswith('api/'): raise NotFound() - return send_from_directory('ui/dist', static_path) + 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():