我正在尝试将RESTAPI的Swagger基本URL从“/”更新为“/testapp”
这是我的招摇配置
swagger_config = {
"headers": [
],
"specs": [
{
"endpoint": 'APISpecification',
"route": '/APISpecification',
"rule_filter": lambda rule: True, # all in
"model_filter": lambda tag: True, # all in
}
],
"static_url_path": "/flasgger_static",
"specs_route": "/swagger_doc/",
}
根据配置,我可以访问位于127.0.0.1:4444/swagger_doc
的招摇过市页面
我想把它改成127.0.0.1:4444/testapp/swagger_doc
我已经尝试在这个配置中使用basePath
作为/testapp
。不起作用
问题是127.0.0.1:4444/swagger_doc
需要一些在127.0.0.1:4444/flasgger_static/
内的.js和.css文件,这些文件应该更改为127.0.0.1:4444/testapp/flasgger_static/
您应该在
swagger_config
中添加"url_prefix": "/testapp"
相关问题 更多 >
编程相关推荐