from flask import Flask | |
from flask_cors import CORS | |
def create_app(): | |
app = Flask(__name__) | |
# 启用CORS支持跨域请求 | |
CORS(app) | |
# Load configuration | |
app.config.from_object('config.Config') | |
# Register blueprints or routes | |
from .routes import main as main_blueprint | |
app.register_blueprint(main_blueprint) | |
return app | |
app = create_app() |