diff --git a/shell.nix b/shell.nix index d251118..49322b8 100644 --- a/shell.nix +++ b/shell.nix @@ -10,6 +10,7 @@ pkgs.mkShell { pkgs.python312Packages.beautifulsoup4 pkgs.python312Packages.pygraphviz pkgs.python312Packages.requests_toolbelt + pkgs.python312Packages.pyaml ]; shellHook = '' python src/main.py diff --git a/src/lib/router.py b/src/lib/router.py index 5a9cbcb..706715c 100644 --- a/src/lib/router.py +++ b/src/lib/router.py @@ -30,7 +30,7 @@ class Route: return response except Exception as e: - log.error(tracebark.format_exc) + log.error(traceback.format_exc) return error_page(500) def matches(self, request: 'Request') -> bool: @@ -38,6 +38,14 @@ class Route: return self.matcher(request.path) routes = [ + Route( + lambda request: request.path == '/style.css', + [Method.GET], + lambda request, *_: Response( + ResponseCode.OK, + *raw_file_contents('./style.css') + ) + ), Route( lambda request: request.path == '/', [Method.GET, Method.POST],