frontend.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:structured-query-engine 作者: apsdehal 项目源码 文件源码
def start(config):
    SERVER_PORT = config["base_port"]
    SERVER_BIND_ADDRESS = config["bind_address"]
    task_id = process.fork_processes(4)
    config = {
        "config": config
    }

    application = web.Application([
        (r"/", InfoHandler, dict(config=config)),
        (r"/([^/]+)", IndexHandler, dict(config=config)),
        (r"/([^/]+)/([^/]+)", IndexQueryHandler, dict(config=config)),
        (r"/([^/]+)/([^/]+)/([^/]+)", IndexQueryHandler, dict(config=config))
    ])

    http_server = httpserver.HTTPServer(application)
    http_server.add_sockets(netutil.bind_sockets(SERVER_PORT + task_id, address=SERVER_BIND_ADDRESS))
    log.info("Frontend listening on %d", SERVER_PORT + task_id)
    IOLoop.current().start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号