python | flask 捕获任意路由

python | flask 捕获任意路由

参考文章:https://www.codenong.com/15117416/

方式如下:

@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def get_dir(path):
    return path
posted @ 2022-10-10 10:37  Mz1  阅读(68)  评论(0编辑  收藏  举报