From 7622fed96fc0afe4a63a31cb47313e29576c98b0 Mon Sep 17 00:00:00 2001 From: th3r00t Date: Mon, 28 Nov 2022 23:05:41 -0500 Subject: [PATCH] Updated sourcemap, and added a test package for template testing. --- src/frontend/lib/FastAPIServer.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/frontend/lib/FastAPIServer.py b/src/frontend/lib/FastAPIServer.py index 534c43d..4dfe9a3 100644 --- a/src/frontend/lib/FastAPIServer.py +++ b/src/frontend/lib/FastAPIServer.py @@ -12,8 +12,10 @@ templates = Jinja2Templates(directory="src/frontend/templates") class FastAPIServer(): + """Entry point for FastAPI server.""" def __init__(self, config): + """Initialize FastAPIServer object parameters.""" self.config = config app.mount("/static", StaticFiles(directory="src/frontend/static"), @@ -27,9 +29,8 @@ class FastAPIServer(): """Compile static files for web frontend.""" _pyShelf_src = sass.compile( filename='src/frontend/static/styles/pyShelf.sass', - source_map_filename='src/frontend/node_modules/bulma/bulma.sass', - output_style='compressed' - ) + source_map_filename='src/frontend/static/styles/pyShelf.sass', + output_style='compressed') with open('src/frontend/static/styles/pyShelf.css', 'w') as _pyShelf: _pyShelf.write(_pyShelf_src[0]) _pyShelf.close() @@ -46,7 +47,12 @@ class FastAPIServer(): """Home page responder.""" return templates.TemplateResponse( "index.html", - {"request": request}) + { + "request": request, + "package": { + "test": "This is a test variable" + } + }) @app.get("/users/me") async def about_me(self):