def load(pglot, user_config):
''' setup the http server '''
# pylint: disable=global-statement, unused-argument
global SERVER, _THREAD
# set configuration
config = DEFAULT_CONFIG
config.update(user_config)
set_config(config)
# create server
SERVER = tornado.web.Application([], {})
SERVER.listen(PORT)
# run server on a thread
_THREAD = threading.Thread(target=run_server)
_THREAD.daemon = True
_THREAD.start()
_LOGGER.info('Started HTTP server on port %d', PORT)
_LOGGER.info('Loaded HTTP element')
评论列表
文章目录