diff --git a/mopidy/frontends/http/actor.py b/mopidy/frontends/http/actor.py index 7eed0937..8678d8b0 100644 --- a/mopidy/frontends/http/actor.py +++ b/mopidy/frontends/http/actor.py @@ -57,6 +57,9 @@ class HttpFrontend(pykka.ThreadingActor, CoreListener): 'tools.staticdir.index': 'index.html', 'tools.staticdir.dir': static_dir, }, + '/api': { + 'request.dispatch': cherrypy.dispatch.MethodDispatcher(), + }, '/ws': { 'tools.websocket.on': True, 'tools.websocket.handler_cls': ws.WebSocketHandler, diff --git a/mopidy/frontends/http/api.py b/mopidy/frontends/http/api.py index b414c60c..0003f06a 100644 --- a/mopidy/frontends/http/api.py +++ b/mopidy/frontends/http/api.py @@ -7,12 +7,13 @@ except ImportError as import_error: class ApiResource(object): + exposed = True + def __init__(self, core): self.core = core - @cherrypy.expose @cherrypy.tools.json_out() - def index(self): + def GET(self): playback_state = self.core.playback.state.get() track = self.core.playback.current_track.get() if track: