from flask import Flask from flask_cors import CORS def create_app(config_class=None): app = Flask(__name__) if config_class: app.config.from_object(config_class) CORS(app) # Register blueprints from app.routes.home import home_bp from app.routes.dictionary import dictionary_bp from app.routes.elearning import elearning_bp from app.routes.api import api_bp app.register_blueprint(home_bp) app.register_blueprint(dictionary_bp, url_prefix="/dictionary") app.register_blueprint(elearning_bp, url_prefix="/learn") app.register_blueprint(api_bp, url_prefix="/api") return app