File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -645,6 +645,25 @@ def _run_server(
645645 """Helper function to run the server with specified settings."""
646646 _load_user_app (app_ref )
647647
648+ # Check if any flows are registered
649+ if not flow .flow_names ():
650+ click .secho (
651+ f"\n Error: No flows registered in '{ app_ref } '.\n " ,
652+ fg = "red" ,
653+ bold = True ,
654+ err = True ,
655+ )
656+ click .secho (
657+ "To use CocoIndex server, you need to define at least one flow." ,
658+ err = True ,
659+ )
660+ click .secho (
661+ "See https://cocoindex.io/docs for more information.\n " ,
662+ fg = "cyan" ,
663+ err = True ,
664+ )
665+ raise click .Abort ()
666+
648667 server_settings = setting .ServerSettings .from_env ()
649668 cors_origins : set [str ] = set (server_settings .cors_origins or [])
650669 if cors_origin is not None :
You can’t perform that action at this time.
0 commit comments