フラスコアプリケーションをクエリするフロントエンドとしてswagger uiを使用しようとしています。私はFlasggerを使用しています以下に示すようにおもちゃの例を試しました
from flasgger import Swagger
from flask import Flask, logging
app = Flask(__name__)
Swagger(app)
# ENDPOINT = 1
@app.route('/hello',methods=['GET'])
def helloapp():
return 'Hello World'
if __name__ == '__main__':
app.run(debug=True,threaded=True,port=7005)
file_handler = logging.FileHandler('app.log')
app.logger.addHandler(file_handler)
app.logger.setLevel(logging.INFO)
エンドポイントを照会しようとするとhttp://localhost:7005/hello
。「Hello World」で結果を取得します。
クエリを実行しようとするとhttp://localhost:7005/apidocs/
、ベース UI が表示されます
しかし、エンドポイントのルートを照会しようとすると. Swagger UI が表示されません。それは私に404エラーをスローします
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
問題は何ですか?