Skip to content

Commit ac6ad7f

Browse files
authored
Merge pull request #132 from AD-SDL/dev
Allow server to run sans Dashboard
2 parents 782849a + cecc9aa commit ac6ad7f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ad_sdl.wei"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "The Rapid Prototyping Laboratory's Workflow Execution Interface."
55
authors = [
66
{name = "Rafael Vescovi", email = "[email protected]"},

src/wei/server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""The server that takes incoming WEI flow requests from the experiment application"""
22

33
from contextlib import asynccontextmanager
4+
from pathlib import Path
45
from typing import Dict
56

67
from fastapi import FastAPI
@@ -49,7 +50,9 @@ async def lifespan(app: FastAPI) -> None: # type: ignore[misc]
4950
app.include_router(module_routes.router, prefix="/modules")
5051
app.include_router(workcell_routes.router, prefix="/workcells")
5152
app.include_router(workcell_routes.router, prefix="/wc")
52-
app.mount("/", StaticFiles(directory="wei/src/ui/dist", html=True))
53+
ui_files_path = Path("wei") / "src" / "ui" / "dist"
54+
if ui_files_path.exists():
55+
app.mount("/", StaticFiles(directory=ui_files_path, html=True))
5356
EventHandler.initialize_diaspora()
5457

5558
if Config.autostart_engine:

0 commit comments

Comments
 (0)