""" moldinsight 入口 — 使用 shared.app_factory.create_app() 构建 """ import os, sys from pathlib import Path src_root = Path(__file__).parent.parent sys.path.insert(0, str(src_root)) os.chdir(Path(__file__).parent.parent.parent) from shared.app_factory import create_app def _register_routers(app): """注册 moldinsight 业务路由""" try: from moldinsight.api import router as moldinsight_router app.include_router(moldinsight_router, prefix="/api") except Exception as e: print(f"[WARN] MoldInsight 路由: {e}") app = create_app( title="Gemold - 模具分析引擎", service_name="moldinsight", mount_html=True, register_routers=_register_routers, )