diff --git a/Data/Engine/config/environment.py b/Data/Engine/config/environment.py index 58ccf66..460b4ea 100644 --- a/Data/Engine/config/environment.py +++ b/Data/Engine/config/environment.py @@ -114,10 +114,15 @@ def _resolve_static_root(project_root: Path) -> Path: candidates = ( project_root / "Engine" / "web-interface" / "build", project_root / "Engine" / "web-interface" / "dist", + project_root / "Engine" / "web-interface", project_root / "Data" / "Engine" / "WebUI" / "build", + project_root / "Data" / "Engine" / "WebUI", project_root / "Data" / "Server" / "web-interface" / "build", + project_root / "Data" / "Server" / "web-interface", project_root / "Data" / "Server" / "WebUI" / "build", + project_root / "Data" / "Server" / "WebUI", project_root / "Data" / "WebUI" / "build", + project_root / "Data" / "WebUI", ) for path in candidates: resolved = path.resolve() diff --git a/Data/Engine/tests/test_config_environment.py b/Data/Engine/tests/test_config_environment.py index b5b46a1..c89ef01 100644 --- a/Data/Engine/tests/test_config_environment.py +++ b/Data/Engine/tests/test_config_environment.py @@ -42,3 +42,20 @@ def test_static_root_env_override(tmp_path, monkeypatch): monkeypatch.delenv("BOREALIS_STATIC_ROOT", raising=False) monkeypatch.delenv("BOREALIS_ROOT", raising=False) + + +def test_static_root_falls_back_to_legacy_source(tmp_path, monkeypatch): + """Legacy WebUI source should be served when no build assets exist.""" + + legacy_source = tmp_path / "Data" / "Server" / "WebUI" + legacy_source.mkdir(parents=True) + (legacy_source / "index.html").write_text("", encoding="utf-8") + + monkeypatch.setenv("BOREALIS_ROOT", str(tmp_path)) + monkeypatch.delenv("BOREALIS_STATIC_ROOT", raising=False) + + settings = load_environment() + + assert settings.flask.static_root == legacy_source.resolve() + + monkeypatch.delenv("BOREALIS_ROOT", raising=False)