rearrange for parts
This commit is contained in:
+14
-11
@@ -22,19 +22,17 @@ def create_app():
|
|||||||
# import oracledb
|
# import oracledb
|
||||||
|
|
||||||
# oracledb.init_oracle_client(lib_dir=None)
|
# 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:
|
try:
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
# Load configuration
|
|
||||||
app.config.from_object(Config)
|
|
||||||
|
|
||||||
CORS(app)
|
|
||||||
|
|
||||||
JWTManager(app)
|
|
||||||
CORS(app, supports_credentials=True)
|
|
||||||
|
|
||||||
# Swagger Doc
|
# Swagger Doc
|
||||||
SWAGGER_URL = app.config.get("SWAGGER_URL")
|
SWAGGER_URL = app.config.get("SWAGGER_URL")
|
||||||
API_URL = app.config.get("API_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)
|
swagger_ui_blueprint = get_swaggerui_blueprint(SWAGGER_URL, API_URL)
|
||||||
app.register_blueprint(swagger_ui_blueprint, url_prefix=SWAGGER_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
|
# Error Handlers
|
||||||
register_error_handlers(app)
|
register_error_handlers(app)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user