http: Document existence of the new frontend
This commit is contained in:
parent
9b90e64dfb
commit
256c5a8179
@ -37,6 +37,7 @@ class Mock(object):
|
||||
|
||||
|
||||
MOCK_MODULES = [
|
||||
'cherrypy',
|
||||
'dbus',
|
||||
'dbus.mainloop',
|
||||
'dbus.mainloop.glib',
|
||||
@ -51,6 +52,11 @@ MOCK_MODULES = [
|
||||
'pykka.registry',
|
||||
'pylast',
|
||||
'serial',
|
||||
'ws4py',
|
||||
'ws4py.messaging',
|
||||
'ws4py.server',
|
||||
'ws4py.server.cherrypyserver',
|
||||
'ws4py.websocket',
|
||||
]
|
||||
for mod_name in MOCK_MODULES:
|
||||
sys.modules[mod_name] = Mock()
|
||||
|
||||
8
docs/modules/frontends/http.rst
Normal file
8
docs/modules/frontends/http.rst
Normal file
@ -0,0 +1,8 @@
|
||||
.. _http-frontend:
|
||||
|
||||
*********************************************
|
||||
:mod:`mopidy.frontends.http` -- HTTP frontend
|
||||
*********************************************
|
||||
|
||||
.. automodule:: mopidy.frontends.http
|
||||
:synopsis: HTTP and WebSockets frontend
|
||||
@ -1,2 +1,36 @@
|
||||
"""
|
||||
Frontend which lets you control Mopidy through HTTP and WebSockets.
|
||||
|
||||
**Dependencies**
|
||||
|
||||
- ``cherrypy``
|
||||
|
||||
- ``ws4py``
|
||||
|
||||
**Settings**
|
||||
|
||||
- :attr:`mopidy.settings.HTTP_SERVER_HOSTNAME`
|
||||
|
||||
- :attr:`mopidy.settings.HTTP_SERVER_PORT`
|
||||
|
||||
**Usage**
|
||||
|
||||
When this frontend is included in :attr:`mopidy.settings.FRONTENDS`, it starts
|
||||
a web server at the port specified by :attr:`mopidy.settings.HTTP_SERVER_PORT`.
|
||||
This web server exposes both a REST web service at the URL ``/api``, and a
|
||||
WebSocket at ``/ws``.
|
||||
|
||||
The REST API gives you access to most Mopidy functionality, while the WebSocket
|
||||
enables Mopidy to instantly push events to the client, as they happen.
|
||||
|
||||
It is also the intention that the frontend should be able to host static files
|
||||
for any external JavaScript client. This has currently not been implemented.
|
||||
|
||||
**API stability**
|
||||
|
||||
This frontend is currently to be regarded as **experimental**, and we are not
|
||||
promising to keep any form of backwards compatibility between releases.
|
||||
"""
|
||||
|
||||
# flake8: noqa
|
||||
from .actor import HttpFrontend
|
||||
|
||||
@ -7,8 +7,8 @@ from mopidy.core import CoreListener
|
||||
|
||||
try:
|
||||
import cherrypy
|
||||
from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool
|
||||
from ws4py.messaging import TextMessage
|
||||
from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool
|
||||
except ImportError as import_error:
|
||||
raise exceptions.OptionalDependencyError(import_error)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user