Files
2026-09-18 18:21:01 +08:00

32 lines
885 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
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
from moldinsight.storage.init_storage import rustfs_startup_hook
def _register_routers(app):
"""注册 moldinsight 业务路由(/api 聚合 + HTML 报告代理,收敛于 moldinsight.api)"""
try:
from moldinsight.api import register_moldinsight_routers
register_moldinsight_routers(app)
except Exception as e:
print(f"[WARN] MoldInsight 路由: {e}")
app = create_app(
title="Gemold - 模具分析引擎",
service_name="moldinsight",
serve_frontend_static=False,
startup_hooks=[rustfs_startup_hook],
register_routers=_register_routers,
)