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.
This commit is contained in:
Sunil Mohan Adapa 2015-01-13 16:07:09 +05:30
parent 2b85416aa2
commit 3fcbb36a21

View File

@ -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]