@@ -60,29 +60,15 @@ def serve(
6060 click .echo (f" Application: http://{ host } :{ port } " )
6161 click .echo (f" API docs: http://{ host } :{ port } /api/docs" )
6262
63- # Check if frontends are built (prod mode)
63+ # Check if frontend is built (prod mode)
6464 if not dev :
6565 static_dir = Path (__file__ ).parent / "backend" / "static"
6666 app_dir = static_dir / "app"
67- map_dir = static_dir / "map"
6867
69- missing = []
7068 if not app_dir .exists () or not (app_dir / "index.html" ).exists ():
71- missing .append (
72- ("App frontend" , "cd frontend/app && npm ci && npm run build" )
73- )
74- if not map_dir .exists () or not (map_dir / "index.html" ).exists ():
75- missing .append (
76- ("Map frontend" , "cd frontend/map && npm ci && npm run build" )
77- )
78-
79- if missing :
80- click .echo (
81- f"Warning: { ', ' .join (m [0 ] for m in missing )} not built!" , err = True
82- )
69+ click .echo ("Error: App frontend not built!" , err = True )
8370 click .echo (" Build with:" , err = True )
84- for _ , cmd in missing :
85- click .echo (f" { cmd } " , err = True )
71+ click .echo (" cd frontend/app && npm ci && npm run build" , err = True )
8672 click .echo (" Or use --dev flag for API-only mode" , err = True )
8773 sys .exit (1 )
8874
@@ -106,30 +92,16 @@ def info() -> None:
10692 click .echo (f"Python: { sys .version .split ()[0 ]} " )
10793 click .echo (f"Python executable: { sys .executable } " )
10894
109- # Check frontends
95+ # Check frontend
11096 static_dir = Path (__file__ ).parent / "backend" / "static"
111- frontends = [
112- ("App" , static_dir / "app" ),
113- ("Map" , static_dir / "map" ),
114- ]
97+ app_dir = static_dir / "app"
98+ app_built = app_dir .exists () and (app_dir / "index.html" ).exists ()
11599
116- built = [
117- (name , d .exists () and (d / "index.html" ).exists ()) for name , d in frontends
118- ]
119-
120- if all (status for _ , status in built ):
121- click .echo ("\n Frontends: Both built and ready" )
100+ if app_built :
101+ click .echo ("\n Frontend: Built and ready" )
122102 else :
123- click .echo ("\n Frontends:" )
124- for (name , _ ), is_built in zip (frontends , built , strict = True ):
125- if is_built :
126- click .echo (f" { name } : Built" )
127- else :
128- click .echo (
129- f" { name } : Not built"
130- f" (run: cd frontend/{ name .lower ()} "
131- " && npm ci && npm run build)"
132- )
103+ click .echo ("\n Frontend: Not built" )
104+ click .echo (" Run: cd frontend/app && npm ci && npm run build" )
133105
134106 click .echo ("\n Environment variables:" )
135107 for key in [
0 commit comments