From 67c92ceab99d1a66962d4223e366cb80a52032ef Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Wed, 28 Nov 2012 19:19:06 +0100 Subject: [PATCH] http: Move resource details to /mopidy/ page --- mopidy/frontends/http/data/index.html | 56 ++++--------------------- mopidy/frontends/http/data/mopidy.html | 58 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 47 deletions(-) create mode 100644 mopidy/frontends/http/data/mopidy.html diff --git a/mopidy/frontends/http/data/index.html b/mopidy/frontends/http/data/index.html index c3a4199b..37885eef 100644 --- a/mopidy/frontends/http/data/index.html +++ b/mopidy/frontends/http/data/index.html @@ -3,65 +3,27 @@ Mopidy HTTP frontend - +

Mopidy HTTP frontend

This web server is a part of the music server Mopidy. To learn more - about Mopidy, please visit www.mopidy.com.

+ about Mopidy, please visit + www.mopidy.com.

Static content serving

-

To see your own content here, change the setting - HTTP_SERVER_STATIC_DIR to point to the directory containing your - content. This can be used to host a web based Mopidy client here.

+

To see your own content instead of this placeholder page, change the + setting HTTP_SERVER_STATIC_DIR to point to the directory + containing your static files. This can be used to host e.g. a pure + HTML/CSS/JavaScript Mopidy client.

-

Even if you host your own content on the root of the web server, - you'll always have the following services available.

+

If you replace this page with your own content, the Mopidy resources + at /mopidy/ will still be available.

- -
-

WebSocket endpoint

- -

Mopidy has a WebSocket endpoint at /mopidy/ws/. You can - use WebSockets to get notified about events happening in Mopidy. The - alternative would be to regularly poll the conventional web service for - updates.

- -

To connect to the endpoint from a browser with WebSocket support, - simply enter the following JavaScript code in the browser's console:

- -
var ws = new WebSocket("ws://myhost:myport/mopidy/ws/');
-ws.onmessage = function (event) {
-  console.log("Incoming message: ", event.data);
-};
-ws.send("Message to the server, ahoy!");
- -

Here you can see events arriving from Mopidy in real time:

- -

-    
- -
-

Documentation

- -

For more information, please refer to the Mopidy documentation at - docs.mopidy.com.

-
- - diff --git a/mopidy/frontends/http/data/mopidy.html b/mopidy/frontends/http/data/mopidy.html new file mode 100644 index 00000000..81fe445a --- /dev/null +++ b/mopidy/frontends/http/data/mopidy.html @@ -0,0 +1,58 @@ + + + + + Mopidy HTTP frontend + + + + +
+

Mopidy HTTP frontend

+ +

This web server is a part of the music server Mopidy. To learn more + about Mopidy, please visit www.mopidy.com.

+
+ +
+

WebSocket endpoint

+ +

Mopidy has a WebSocket endpoint at /mopidy/ws/. You can use + this end point to access Mopidy's full API, and to get notified about + events happening in Mopidy.

+
+ +
+

Example

+ +

Here you can see events arriving from Mopidy in real time:

+ +

+
+      

Nothing to see? Try playing a track using your MPD client.

+
+ +
+

Documentation

+ +

For more information, please refer to the Mopidy documentation at + docs.mopidy.com.

+
+ + + +