From 9fabc4909315f03ff0962c3956f1bb3bb29019a2 Mon Sep 17 00:00:00 2001 From: Ayo Date: Mon, 9 Mar 2026 16:22:39 +0100 Subject: [PATCH] chore: comment code explanations --- web.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web.py b/web.py index 5de0943..72384f0 100755 --- a/web.py +++ b/web.py @@ -33,11 +33,11 @@ def home(): @app.route('/') def dist(path): try: - if '.' in path: + if '.' in path: # if path has a dot, we assume it is a file - serve as is return send_from_directory('dist', path) - else: + else: # otherwise, it must be a web URL path, then try to return the index.html return send_from_directory('dist', path + '/index.html') - except: + except: # if nothing was found, return an error 404 return send_from_directory('dist', '404.html'), 404 @app.errorhandler(404) @@ -53,4 +53,3 @@ def empty_view(): if __name__ == '__main__': app.run(host='0.0.0.0') -