aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim/webui/app.py')
-rw-r--r--fg21sim/webui/app.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/fg21sim/webui/app.py b/fg21sim/webui/app.py
index 63d80be..4fa0a05 100644
--- a/fg21sim/webui/app.py
+++ b/fg21sim/webui/app.py
@@ -2,16 +2,20 @@
# MIT license
"""
-Web user interface (UI) of "fg21sim" based upon Tornado_.
+Web user interface (UI) of "fg21sim" based upon Tornado_ web server and
+using the WebSocket_ protocol.
.. _Tornado: http://www.tornadoweb.org/
+
+.. _WebSocket: https://en.wikipedia.org/wiki/WebSocket ,
+ http://caniuse.com/#feat=websockets
"""
import os
import tornado.web
-from .websocket import EchoWSHandler
+from .websocket import FG21simWSHandler
class IndexHandler(tornado.web.RequestHandler):
@@ -20,7 +24,8 @@ class IndexHandler(tornado.web.RequestHandler):
_settings = {
- # The static files will be served from the default "/static/" URI
+ # The static files will be served from the default "/static/" URI.
+ # Recommend to use `{{ static_url(filepath) }}` in the templates.
"static_path": os.path.join(os.path.dirname(__file__), "static"),
"template_path": os.path.join(os.path.dirname(__file__), "templates"),
}
@@ -32,6 +37,6 @@ def make_application(**kwargs):
appplication = tornado.web.Application(
handlers=[
(r"/", IndexHandler),
- (r"/ws", EchoWSHandler),
+ (r"/ws", FG21simWSHandler),
], **settings)
return appplication