2019-03-01 20:16:04 +02:00
|
|
|
import tornado.web
|
|
|
|
|
import tornado.websocket
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
from handlers.MainHandler import MainHandler
|
2019-03-01 21:59:49 +02:00
|
|
|
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):
|
|
|
|
|
handlers = [(r"/", MainHandler),
|
2019-03-01 21:59:49 +02:00
|
|
|
(r"/websocket", ChameleonWebSocket),
|
2019-03-01 20:16:04 +02:00
|
|
|
(r"/CSS/(.*)", tornado.web.StaticFileHandler, {'path': os.path.join(os.path.dirname(__file__), "../../Site/CSS")}),
|
2019-03-02 21:17:48 +02:00
|
|
|
(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")})]
|
2019-03-02 00:12:41 +02:00
|
|
|
|
2019-03-01 20:16:04 +02:00
|
|
|
settings = dict(
|
|
|
|
|
template_path=os.path.join(os.path.dirname(__file__), "../../Site")
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
super(ChameleonApplication, self).__init__(handlers, **settings)
|