From 33807314f45dc89de0032eb7242dff0c12b003f2 Mon Sep 17 00:00:00 2001 From: gnat Date: Sun, 20 Oct 2024 22:04:33 -0700 Subject: [PATCH] backend change for alternative thought viewing frontend --- src/lib/router.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/router.py b/src/lib/router.py index 9bda274..6c4f40b 100644 --- a/src/lib/router.py +++ b/src/lib/router.py @@ -83,11 +83,11 @@ routes = [ Route( lambda path: os.path.isfile('.' + path.path) and path.path.startswith('/html/') and (path.path.endswith('.html') or '/thoughts/' in path.path), [Method.GET], - lambda request, *_: Response( + lambda request, *_: [print(request.path), Response( ResponseCode.OK, {'Content-Type': 'text/html'}, - parse_file('.' + request.path.path, dict(prev=request.headers.get('Referer').replace('/', '\\/') if request.headers.has('Referer') else '')).encode('utf-8') - ) + parse_file('.' + request.path.path, dict((k, v.replace('\'', '')) for k, v in map(lambda item: (item[0], item[1]), request.path.params.items()))).encode('utf-8') + )][-1] ), Route( lambda path: os.path.isfile('.' + path.path) and (path.path.startswith('/font/') or path.path.startswith('/files/')),