from flask import Flask
from .routes import main_bp
from flask_cors import CORS


def create_app():
    app = Flask(__name__)
    CORS(app)

    # 注册蓝图, 使得蓝图中的路由生效
    app.register_blueprint(main_bp)
    return app
