web socket using tornado

This commit is contained in:
ori agranat
2019-03-01 21:59:49 +02:00
parent 366466260c
commit 05305393a9
9 changed files with 29 additions and 35 deletions

View File

@@ -3,6 +3,7 @@ import tornado.websocket
import os
from handlers.MainHandler import MainHandler
from handlers.SocketHandler import ChameleonWebSocket
from tornado.options import define
define("port", default=8888, help="run on the given port", type=int)
@@ -11,6 +12,7 @@ define("port", default=8888, help="run on the given port", type=int)
class ChameleonApplication(tornado.web.Application):
def __init__(self):
handlers = [(r"/", MainHandler),
(r"/websocket", ChameleonWebSocket),
(r"/CSS/(.*)", tornado.web.StaticFileHandler, {'path': os.path.join(os.path.dirname(__file__), "../../Site/CSS")}),
(r"/JS/(.*)", tornado.web.StaticFileHandler,
{'path': os.path.join(os.path.dirname(__file__), "../../Site/JS")})]