bottle_api.py 文件源码

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

项目:captaincloud 作者: bpsagar 项目源码 文件源码
def make_app(*apps):
    """Make a bottle app from the instance"""
    app = Bottle()

    for mount, instance in apps:
        sub_app = Bottle()
        for method_name in get_methods(instance):
            method = getattr(instance, method_name)
            route = '/%s/' % method_name
            sub_app.route(route, method='POST')(view_wrapper(method))

        app.mount(mount, sub_app)

    return app
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号