Files
PhotonVision/Python/app/ChameleonVisionApp.py
ori agranat f6dc1e8094 fixed an error in websockets and uploded vue
fixed an error in websockets and uploded vue
2019-03-08 15:55:53 +02:00

27 lines
1.2 KiB
Python

import tornado.web
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)
class ChameleonApplication(tornado.web.Application):
def __init__(self):
handlers = [(r"/", MainHandler),
(r"/websocket", ChameleonWebSocket),
#always keep websocket up here and not under any handler
(r"/(.*)", tornado.web.StaticFileHandler, {'path': os.path.join(os.path.dirname(__file__), "../../Site")}),
(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")}),
(r"/assets/(.*)", tornado.web.StaticFileHandler, {'path': os.path.join(os.path.dirname(__file__), "../../Site/assets")})]
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "../../Site")
)
super(ChameleonApplication, self).__init__(handlers, **settings)