http: Add /mopidy/ static dir that is always available

This commit is contained in:
Stein Magnus Jodal 2012-11-28 19:18:13 +01:00
parent 96a31adf63
commit c1e60ba378

View File

@ -54,12 +54,19 @@ class HttpFrontend(pykka.ThreadingActor, CoreListener):
static_dir = os.path.join(os.path.dirname(__file__), 'data')
logger.debug('HTTP server will serve "%s" at /', static_dir)
mopidy_dir = os.path.join(os.path.dirname(__file__), 'data')
config = {
b'/': {
'tools.staticdir.on': True,
'tools.staticdir.index': 'index.html',
'tools.staticdir.dir': static_dir,
},
b'/mopidy': {
'tools.staticdir.on': True,
'tools.staticdir.index': 'mopidy.html',
'tools.staticdir.dir': mopidy_dir,
},
b'/mopidy/ws': {
'tools.websocket.on': True,
'tools.websocket.handler_cls': ws.WebSocketHandler,