From 550895b8effd48b756f12977b6a2336b7add48a3 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 17 Oct 2025 19:22:29 -0400 Subject: [PATCH] rearrange for parts --- app/__init__.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index deb9ed6..6ed6ea4 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -22,19 +22,17 @@ def create_app(): # import oracledb # oracledb.init_oracle_client(lib_dir=None) + app = Flask(__name__) + + # Load configuration + app.config.from_object(Config) + + CORS(app) + JWTManager(app) + CORS(app, supports_credentials=True) + try: - - app = Flask(__name__) - - # Load configuration - app.config.from_object(Config) - - CORS(app) - - JWTManager(app) - CORS(app, supports_credentials=True) - # Swagger Doc SWAGGER_URL = app.config.get("SWAGGER_URL") API_URL = app.config.get("API_URL") @@ -45,6 +43,11 @@ def create_app(): swagger_ui_blueprint = get_swaggerui_blueprint(SWAGGER_URL, API_URL) app.register_blueprint(swagger_ui_blueprint, url_prefix=SWAGGER_URL) + except Exception as e: + print(f"Swagger Unexpected error occurred: {e}") + + + try: # Error Handlers register_error_handlers(app)