]> git.ipfire.org Git - people/ms/westferry.git/commitdiff
webapp: Serve the frontend application
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 May 2025 14:12:44 +0000 (14:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 May 2025 14:12:44 +0000 (14:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/westferry/application.py
src/westferry/constants.py.in
src/westferry/handlers/index.py

index 4ceab27b1ae5c8c31d5baa459ed49d6b760ecc23..f6545f96d3f1df64ea8e01bf8bec127db750e89b 100644 (file)
@@ -320,7 +320,6 @@ substitutions = \
        '|configsdir=$(configsdir)|' \
        '|bindir=$(bindir)|' \
        '|datadir=$(datadir)|' \
-       '|templatesdir=$(templatesdir)|' \
        '|webrootdir=$(webrootdir)|'
 
 SED_PROCESS = \
index 0898940039b7c7db60cb5e5b1a56ec2dd19a56f9..b2befb6ff4429433f5f056441c48323f4b19a1ea 100644 (file)
@@ -19,6 +19,7 @@
 #                                                                             #
 ###############################################################################
 
+import os.path
 import tornado.web
 
 from . import backend
@@ -33,11 +34,12 @@ class WebApplication(tornado.web.Application):
                        # Enable compressed output
                        "compress_response" : True,
 
-                       # Serve static files from our webroot
-                       "static_path" : WEBROOTDIR,
-
                        # Templates
-                       "template_path" : TEMPLATESDIR,
+                       "template_path" : WEBROOTDIR,
+
+                       # Serve assets
+                       "static_path" : os.path.join(WEBROOTDIR, "assets"),
+                       "static_url_prefix" : "/assets/",
 
                        # Use Cross-Site-Request-Forgery protection
                        "xsrf_cookies" : True,
index 0e4d6c25a4ac183af7f72017180bf181cbd1564c..e7c934478a0d0e23fbe72b6d875ffdc20c0eae2c 100644 (file)
@@ -22,5 +22,4 @@
 PACKAGE_NAME = "@PACKAGE_NAME@"
 PACKAGE_VERSION = "@PACKAGE_VERSION@"
 
-TEMPLATESDIR = "@templatesdir@"
 WEBROOTDIR = "@webrootdir@"
index 097d4abb6eb5fea37b8c4d534463f2a5a2cfc285..35b65a1fb7e70977fccc8a3f2bfa65aa83fbb671 100644 (file)
@@ -28,4 +28,4 @@ class IndexHandler(base.BaseHandler):
 
        #@tornado.web.authenticated
        def get(self):
-               self.render("base.html")
+               self.render("index.html")