blob: c50a674f9ebceb39ec1c20fdbeb49d74ed822b10 [file] [log] [blame]
Raverafc93da2025-06-15 18:12:49 +08001from flask import Flask
2from flask_cors import CORS
3
4def create_app():
5 app = Flask(__name__)
6
7 # 启用CORS支持跨域请求
8 CORS(app)
9
10 # Load configuration
11 app.config.from_object('config.Config')
12
13 # Register blueprints or routes
14 from .routes import main as main_blueprint
15 app.register_blueprint(main_blueprint)
Raverd7895172025-06-18 17:54:38 +080016
17 # Register recommendation blueprint
18 from .blueprints.recommend import recommend_bp
19 app.register_blueprint(recommend_bp)
Raverafc93da2025-06-15 18:12:49 +080020
21 return app
22
23app = create_app()