quote.py 文件源码

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

项目:anaconda-project 作者: Anaconda-Platform 项目源码 文件源码
def __init__(self, port, address, prefix, hosts):
        assert prefix is not None
        assert port is not None
        assert address is not None
        self.application = falcon.API(middleware=HostFilter(hosts))
        # add_route is pedantic about this
        if prefix != '' and not prefix.startswith("/"):
            prefix = "/" + prefix
        self.application.add_route(prefix + '/quote', QuoteResource())
        self.application.add_route(prefix + "/", IndexResource(prefix))
        self.port = port
        self.address = address
        self.prefix = prefix
        super(QuoteApplication, self).__init__()

        print("Only connections via these hosts are allowed: " + repr(hosts))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号