wangxi há 1 semana atrás
pai
commit
5a805f83de
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      src/step4_web/api.py

+ 2 - 0
src/step4_web/api.py

@@ -536,6 +536,8 @@ async def root():
     return FileResponse(HTML_DIR / "knowledge_graph_3d.html")
 
 app.mount("/html", StaticFiles(directory=str(HTML_DIR), html=True), name="frontend-html")
+# Generated artifacts are absent on a fresh checkout; create their directory before mounting.
+OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
 app.mount("/output", StaticFiles(directory=str(OUTPUT_DIR), html=False), name="frontend-output")
 app.mount("/", StaticFiles(directory=str(HTML_DIR), html=True), name="frontend")