run.py 文件源码

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

项目:perseids-manifold 作者: RDACollectionsWG 项目源码 文件源码
def apidocs():
    url = urlparse(request.url)
    if ":" in url.netloc:
        host, port = url.netloc.split(":")
    else:
        host = url.netloc
        port = "80"
    base_path = url.path.replace('/apidocs','') if url.path != "/apidocs" else "/"
    schemes = [url.scheme]
    other_scheme = "https" if url.scheme is "http" else "http"
    try:
        if request.get(other_scheme+"://"+url.netloc+url.path.replace('/apidocs','')+"/scheme").status_code is 200:
            schemes += [other_scheme]
    except:
        pass
    r = make_response(swagger.json(schemes, host, port, base_path))
    r.mimetype = 'application/json'
    return r
    # return send_from_directory("www","swagger.json")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号