This commit is contained in:
2026-09-18 18:21:01 +08:00
parent e728dcd226
commit c51e6b793a
10 changed files with 71 additions and 53 deletions
+5 -11
View File
@@ -10,23 +10,17 @@ 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):
"""注册 unified 业务路由"""
"""注册 unified 业务路由(moldinsight 单点聚合 + inventory)"""
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}")
try:
from inventory.api import inventory_router
app.include_router(inventory_router)
@@ -37,7 +31,7 @@ def _register_routers(app):
app = create_app(
title="Gemold - Unified Backend",
service_name="unified",
connect_rustfs=True,
serve_frontend_static=False,
startup_hooks=[rustfs_startup_hook],
register_routers=_register_routers,
)