24 lines
735 B
Python
24 lines
735 B
Python
from flask import Flask
|
|
|
|
def create_app(config_class='config.Config'):
|
|
app = Flask(__name__)
|
|
app.config.from_object(config_class)
|
|
app.json.ensure_ascii = False # type: ignore
|
|
|
|
# 注册蓝图
|
|
from app.routes.pages import page_bp
|
|
app.register_blueprint(page_bp)
|
|
|
|
from app.routes.cards import card_bp
|
|
app.register_blueprint(card_bp, url_prefix="/card")
|
|
|
|
from app.routes.reactions import reaction_bp
|
|
app.register_blueprint(reaction_bp, url_prefix="/reaction")
|
|
|
|
from app.routes.matters import matter_bp
|
|
app.register_blueprint(matter_bp, url_prefix="/matter")
|
|
|
|
from app.routes.assets import asset_bp
|
|
app.register_blueprint(asset_bp, url_prefix="/asset")
|
|
|
|
return app |