From 3fcbb36a2112d9fb5e19dae75bb2551ef53b52fb Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 13 Jan 2015 16:07:09 +0530 Subject: [PATCH] Serve /usr/share/javscript on /javascript Since the links to javascript libraries have been removed in favor of using javscript-common, it is no longer possible to run Plinth stand alone without a reverse proxy that also serves /javscript. This patch fixes that. Now /javascirpt is also available when Plinth is running stand alone. --- plinth/__main__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plinth/__main__.py b/plinth/__main__.py index e0bd5f5ea..dae4fb278 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -109,6 +109,15 @@ def setup_server(): LOGGER.debug('Serving static directory %s on %s', static_dir, django.conf.settings.STATIC_URL) + js_dir = '/usr/share/javascript' + js_url = '/javascript' + config = { + '/': {'tools.staticdir.root': js_dir, + 'tools.staticdir.on': True, + 'tools.staticdir.dir': '.'}} + cherrypy.tree.mount(None, js_url, config) + LOGGER.debug('Serving javascript directory %s on %s', js_dir, js_url) + for module_import_path in module_loader.loaded_modules: module = importlib.import_module(module_import_path) module_name = module_import_path.split('.')[-1]