Files
PhotonVision/backend/app/ChameleonVisionApp.py

28 lines
899 B
Python
Raw Normal View History

2019-03-01 20:16:04 +02:00
import tornado.web
import tornado.websocket
import os
2019-03-09 23:49:50 +02:00
from .handlers.MainHandler import MainHandler
from .handlers.SocketHandler import ChameleonWebSocket
2019-03-01 20:16:04 +02:00
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):
2019-03-23 23:42:24 +02:00
handlers = [
(r"/", MainHandler),
(r"/websocket", ChameleonWebSocket),
(r"/(.*)", tornado.web.StaticFileHandler,
{"path": r"{0}".format(os.path.join(os.path.dirname(__file__), "site"))}),
]
2019-03-02 00:12:41 +02:00
settings = dict({
"template_path": os.path.join(os.path.dirname(__file__), "site"),
"static_path": os.path.join(os.path.dirname(__file__), "site"),
"debug": True
}
2019-03-01 20:16:04 +02:00
)
super(ChameleonApplication, self).__init__(handlers, **settings)