Initial tornado application

This commit is contained in:
Sagi Frimer
2019-03-01 20:16:04 +02:00
parent caa78379e2
commit 1960cd434b
12 changed files with 40 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
import tornado.web
import tornado.websocket
import os
from handlers.MainHandler import MainHandler
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"/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")})]
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "../../Site")
)
super(ChameleonApplication, self).__init__(handlers, **settings)