如何在flask中呈现swagger api文档模板?
我正在尝试为我的FlaskAPI呈现一个招摇过市的api文档模板。但当我将“dist”目录放入我的项目时,按照一些教程,我仍然没有渲染任何内容 这是我的代码:如何在flask中呈现swagger api文档模板?,api,flask,swagger,Api,Flask,Swagger,我正在尝试为我的FlaskAPI呈现一个招摇过市的api文档模板。但当我将“dist”目录放入我的项目时,按照一些教程,我仍然没有渲染任何内容 这是我的代码: app = Flask(__name__, template_folder="dist") @app.route("/docs") def get_docs(): return render_template('index.html') 在文件夹“dist”文件“index.html”中,
app = Flask(__name__, template_folder="dist")
@app.route("/docs")
def get_docs():
return render_template('index.html')
在文件夹“dist”文件“index.html”中,我将函数SwaggerUIBundle的路径url修改为我的.yaml文件。当我启动应用程序时,我收到如下消息:
127.0.0.1 - - [08/Sep/2020 13:37:09] "GET /docs HTTP/1.1" 200 -
127.0.0.1 - - [08/Sep/2020 13:37:09] "GET /swagger-ui-bundle.js HTTP/1.1" 404 -
127.0.0.1 - - [08/Sep/2020 13:37:09] "GET /swagger-ui.css HTTP/1.1" 404 -
127.0.0.1 - - [08/Sep/2020 13:37:09] "GET /swagger-ui-standalone-preset.js HTTP/1.1" 404 -
127.0.0.1 - - [08/Sep/2020 13:37:09] "GET /swagger-ui-standalone-preset.js HTTP/1.1" 404 -
我什么也不做。有人知道怎么修吗