From ce5e8affa90bca0c1873e385a1cc386063d16aa1 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Tue, 27 May 2025 12:11:39 -0600 Subject: [PATCH] arrange for cherrypy to serve /usr/share/javascript content at /javascript --- ui/app.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/app.py b/ui/app.py index c79ef9f..14bdaee 100755 --- 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 . 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, } } -- 2.47.2