Alexramsal commited on
Commit
45c92e8
·
1 Parent(s): e06c0eb

fix: replace RuntimeError with a warning for missing frontend directory

Browse files
Files changed (1) hide show
  1. daggr/server.py +4 -2
daggr/server.py CHANGED
@@ -150,9 +150,11 @@ class DaggrServer:
150
  def _setup_routes(self):
151
  frontend_dir = Path(__file__).parent / "frontend" / "dist"
152
  if not frontend_dir.exists():
153
- raise RuntimeError(
 
154
  f"Frontend not found at {frontend_dir}. "
155
- "If developing, run 'npm run build' in daggr/frontend/"
 
156
  )
157
 
158
  @self.app.get("/theme.css", response_class=PlainTextResponse)
 
150
  def _setup_routes(self):
151
  frontend_dir = Path(__file__).parent / "frontend" / "dist"
152
  if not frontend_dir.exists():
153
+ import warnings
154
+ warnings.warn(
155
  f"Frontend not found at {frontend_dir}. "
156
+ "Serving development UI. For production, run 'npm run build' in daggr/frontend/",
157
+ RuntimeWarning
158
  )
159
 
160
  @self.app.get("/theme.css", response_class=PlainTextResponse)