A Flask blueprint to easily integrate the OpenAPI WebUI (React frontend) into any Flask app.
- Build your React frontend (OpenAPI_UI) and ensure the
build/
directory exists. - Install this module in your Flask project (copy or pip install).
- Register the blueprint:
from flask import Flask
from openapi_webui import create_openapi_webui_blueprint
app = Flask(__name__)
# Serve the UI at /openapi-ui
app.register_blueprint(create_openapi_webui_blueprint(url_prefix="/openapi-ui"))
# ... your other routes ...
if __name__ == "__main__":
app.run(debug=True)
url_prefix
: The route prefix to serve the UI (default:/openapi-ui
)build_dir
: Path to the React build directory (default:../OpenAPI_UI/build
relative to this module)
- Make sure the
build/
directory is present and up-to-date. - This blueprint supports client-side routing (SPA fallback to
index.html
).