2018-02-12 18:04:59 +01:00

24 lines
860 B
Python

from tornado.ioloop import IOLoop
from tornado.web import Application
from tao.config import taoenv
from tfw.config import tfwenv
from handlers import SolutionCheckHandler, TestHandler
from tfw.networking.async_solvable_connector import AsyncSolvableConnector
from tfw.config.logs import logging
log = logging.getLogger(__name__)
if __name__ == '__main__':
solvable_connector = AsyncSolvableConnector()
routes = [
(r'/{secret}/?'.format(secret=taoenv.SECRET), SolutionCheckHandler, {'solvable_connector': solvable_connector}),
(r'/{secret}/test/?'.format(secret=taoenv.SECRET), TestHandler, {'solvable_connector': solvable_connector})
]
app = Application(
routes
)
app.listen(tfwenv.CRP_LISTENER_PORT)
log.debug('Controller listening on {}'.format(tfwenv.CRP_LISTENER_PORT))
IOLoop.instance().start()