代码如下:
@app.route('/get_dir/<path>') def get_dir(path): return path
发布于 2018-02-07 08:09:07
如果还想匹配根目录(前导斜杠和空路径),则可以添加另一个为路径参数设置默认值的规则。
@app.route('/', defaults={'path': ''}) @app.route('/<path:path>') def get_dir(path): return path
相似问题
领取专属 10元无门槛券
AI混元助手 在线答疑
洞察 腾讯核心技术
剖析业界实践案例