x
This commit is contained in:
@@ -10,28 +10,22 @@ sys.path.insert(0, str(src_root))
|
||||
os.chdir(Path(__file__).parent.parent.parent)
|
||||
|
||||
from shared.app_factory import create_app
|
||||
from moldinsight.storage.init_storage import rustfs_startup_hook
|
||||
|
||||
|
||||
def _register_routers(app):
|
||||
"""注册 moldinsight 业务路由"""
|
||||
"""注册 moldinsight 业务路由(/api 聚合 + HTML 报告代理,收敛于 moldinsight.api)"""
|
||||
try:
|
||||
from moldinsight.api import router as moldinsight_router
|
||||
app.include_router(moldinsight_router, prefix="/api")
|
||||
from moldinsight.api import register_moldinsight_routers
|
||||
register_moldinsight_routers(app)
|
||||
except Exception as e:
|
||||
print(f"[WARN] MoldInsight 路由: {e}")
|
||||
|
||||
# D11:HTML 报告代理挂根路径,URL 形状与原 StaticFiles 保持一致(/html/{filename})
|
||||
try:
|
||||
from moldinsight.api.html_report_router import include_into as include_html_report
|
||||
include_html_report(app)
|
||||
except Exception as e:
|
||||
print(f"[WARN] HTML 报告路由: {e}")
|
||||
|
||||
|
||||
app = create_app(
|
||||
title="Gemold - 模具分析引擎",
|
||||
service_name="moldinsight",
|
||||
connect_rustfs=True,
|
||||
serve_frontend_static=False,
|
||||
startup_hooks=[rustfs_startup_hook],
|
||||
register_routers=_register_routers,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user