web: Remove WebSocket demo page
This commit is contained in:
parent
47ca709c6a
commit
59760bb36c
@ -23,7 +23,7 @@
|
|||||||
HTML/CSS/JavaScript Mopidy client.</p>
|
HTML/CSS/JavaScript Mopidy client.</p>
|
||||||
|
|
||||||
<p>If you replace this page with your own content, the Mopidy resources
|
<p>If you replace this page with your own content, the Mopidy resources
|
||||||
at <a href="/mopidy/">/mopidy/</a> will still be available.</p>
|
and APIs at <tt>/mopidy/</tt> will still be available.</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,52 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Mopidy HTTP frontend</title>
|
|
||||||
<link rel="stylesheet" type="text/css" href="mopidy.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="box focus">
|
|
||||||
<h1>Mopidy HTTP frontend</h1>
|
|
||||||
|
|
||||||
<p>This web server is a part of the music server Mopidy. To learn more
|
|
||||||
about Mopidy, please visit <a
|
|
||||||
href="http://www.mopidy.com/">www.mopidy.com</a>.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<h2>WebSocket endpoint</h2>
|
|
||||||
|
|
||||||
<p>Mopidy has a WebSocket endpoint at <tt>/mopidy/ws/</tt>. You can use
|
|
||||||
this end point to access Mopidy's full API, and to get notified about
|
|
||||||
events happening in Mopidy.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<h2>Example</h2>
|
|
||||||
|
|
||||||
<p>Here you can see events arriving from Mopidy in real time:</p>
|
|
||||||
|
|
||||||
<pre id="ws-console"></pre>
|
|
||||||
|
|
||||||
<p>Nothing to see? Try playing a track using your MPD client.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box focus">
|
|
||||||
<h2>Documentation</h2>
|
|
||||||
|
|
||||||
<p>For more information, please refer to the Mopidy documentation at
|
|
||||||
<a href="http://docs.mopidy.com/">docs.mopidy.com</a>.</p>
|
|
||||||
</div>
|
|
||||||
<script src="mopidy.js" type="text/javascript"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var ws = new WebSocket("ws://" + document.location.host + "/mopidy/ws/");
|
|
||||||
ws.onmessage = function (message) {
|
|
||||||
var console = document.getElementById('ws-console');
|
|
||||||
var newLine = (new Date()).toLocaleTimeString() + ": " +
|
|
||||||
message.data + "\n";
|
|
||||||
console.innerHTML = newLine + console.innerHTML;
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -25,7 +25,7 @@ def mopidy_app_factory(config, core):
|
|||||||
}),
|
}),
|
||||||
(r'/(.*)', StaticFileHandler, {
|
(r'/(.*)', StaticFileHandler, {
|
||||||
'path': os.path.join(os.path.dirname(__file__), 'data'),
|
'path': os.path.join(os.path.dirname(__file__), 'data'),
|
||||||
'default_filename': 'mopidy.html'
|
'default_filename': 'index.html'
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class RootAppTest(HttpServerTest):
|
|||||||
response = self.fetch('/', method='GET')
|
response = self.fetch('/', method='GET')
|
||||||
|
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'Static content serving',
|
'This web server is a part of the Mopidy music server.',
|
||||||
tornado.escape.to_unicode(response.body))
|
tornado.escape.to_unicode(response.body))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
response.headers['X-Mopidy-Version'], mopidy.__version__)
|
response.headers['X-Mopidy-Version'], mopidy.__version__)
|
||||||
@ -59,7 +59,7 @@ class MopidyAppTest(HttpServerTest):
|
|||||||
response = self.fetch('/mopidy/', method='GET')
|
response = self.fetch('/mopidy/', method='GET')
|
||||||
|
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'Here you can see events arriving from Mopidy in real time:',
|
'This web server is a part of the Mopidy music server.',
|
||||||
tornado.escape.to_unicode(response.body))
|
tornado.escape.to_unicode(response.body))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
response.headers['X-Mopidy-Version'], mopidy.__version__)
|
response.headers['X-Mopidy-Version'], mopidy.__version__)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user