2026-01-02 17:12:24 +08:00
|
|
|
from flask import Flask
|
|
|
|
|
|
2026-01-20 08:51:44 +08:00
|
|
|
def create_app(config_class='config.Config'):
|
2026-01-02 17:12:24 +08:00
|
|
|
app = Flask(__name__)
|
|
|
|
|
app.config.from_object(config_class)
|
|
|
|
|
|
|
|
|
|
# 注册蓝图
|
|
|
|
|
from app.routes.pages import page_bp
|
|
|
|
|
app.register_blueprint(page_bp)
|
2026-01-03 17:19:39 +08:00
|
|
|
|
|
|
|
|
from app.routes.cards import card_bp
|
2026-01-05 09:30:43 +08:00
|
|
|
app.register_blueprint(card_bp, url_prefix="/card")
|
|
|
|
|
|
|
|
|
|
from app.routes.reactions import reaction_bp
|
|
|
|
|
app.register_blueprint(reaction_bp, url_prefix="/reaction")
|
2026-01-05 13:07:53 +08:00
|
|
|
|
|
|
|
|
from app.routes.matters import matter_bp
|
|
|
|
|
app.register_blueprint(matter_bp, url_prefix="/matter")
|
2026-01-20 09:34:24 +08:00
|
|
|
|
|
|
|
|
from app.routes.assets import asset_bp
|
|
|
|
|
app.register_blueprint(asset_bp, url_prefix="/asset")
|
2026-01-02 17:12:24 +08:00
|
|
|
|
|
|
|
|
return app
|