From e311d152995e4ee73f5f8b418f1a5c91fb0d035a Mon Sep 17 00:00:00 2001 From: Sudo-JHare Date: Wed, 4 Jun 2025 19:43:37 +1000 Subject: [PATCH] Update app.py --- app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 2648253..6f901f9 100644 --- a/app.py +++ b/app.py @@ -17,6 +17,7 @@ from sqlalchemy.exc import OperationalError from sqlalchemy import text from wtforms import StringField, URLField, SubmitField from wtforms.validators import DataRequired, URL +from werkzeug.middleware.proxy_fix import ProxyFix sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) @@ -33,6 +34,7 @@ migrate = Migrate() def create_app(): app = Flask(__name__, instance_relative_config=True) + app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1, x_for=1) app.config.from_mapping( SECRET_KEY=os.environ.get('SECRET_KEY', 'dev-secret-key-for-fhirvine'), SQLALCHEMY_DATABASE_URI=os.environ.get('DATABASE_URL', f'sqlite:///{os.path.join(app.instance_path, "fhirvine.db")}'), @@ -71,7 +73,7 @@ def create_app(): }, "host": "localhost:5001", "basePath": "/oauth2", - "schemes": ["http"] + "schemes": ["https"] } swagger_config = { "specs": [ @@ -579,6 +581,8 @@ def create_app(): } }) def custom_apidocs(): + spec_url = url_for('flasgger.apispec_1', _external=True) + logger.debug(f"Swagger spec URL: {spec_url}") return render_template('swagger-ui.html') @app.route('/about')