]> git.gag.com Git - fw/quantimotor/commitdiff
arrange for cherrypy to serve /usr/share/javascript content at /javascript
authorBdale Garbee <bdale@gag.com>
Tue, 27 May 2025 18:11:39 +0000 (12:11 -0600)
committerBdale Garbee <bdale@gag.com>
Tue, 27 May 2025 18:11:39 +0000 (12:11 -0600)
ui/app.py

index c79ef9f9afb834f52b459ea1313367fe34cfba09..14bdaee0e375139b1c8f8a09308682adee4bb057 100755 (executable)
--- a/ui/app.py
+++ b/ui/app.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#! /usr/bin/python3
 # -*- coding: utf-8 -*-
 #
 # Copyright (C) 2025 Bdale Garbee <bdale@gag.com>.  GPLv3+
@@ -178,7 +178,8 @@ def manageLEDs():
   else:
     set_line_values("/dev/gpiochip0", {21: Value.ACTIVE})
 
-path   = os.path.abspath(os.path.dirname(__file__))
+path = os.path.abspath(os.path.dirname(__file__))
+javascript_path = os.path.abspath("/usr/share/javascript")
 config = {
   'global' : {
     'server.socket_host' : '0.0.0.0',
@@ -190,7 +191,11 @@ config = {
   '/': {
     'tools.staticdir.on': True,
     'tools.staticdir.dir': path,
-    'tools.staticdir.index': 'index.html'
+    'tools.staticdir.index': 'index.html',
+  },
+  '/javascript': {
+    'tools.staticdir.on': True,
+    'tools.staticdir.dir': javascript_path,
   }
 }