MCPcopy Create free account
hub / github.com/ComfyWorkflows/ComfyUI-Launcher / list_projects

Function list_projects

server/server.py:78–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76
77@app.route("/api/projects", methods=["GET"])
78def list_projects():
79 projects = []
80 for proj_folder in os.listdir(PROJECTS_DIR):
81 full_proj_path = os.path.join(PROJECTS_DIR, proj_folder)
82 if not os.path.isdir(full_proj_path):
83 continue
84 launcher_state, _ = get_launcher_state(full_proj_path)
85 if not launcher_state:
86 continue
87 project_port = get_project_port(proj_folder)
88 projects.append(
89 {
90 "id": proj_folder,
91 "state": launcher_state,
92 "project_folder_name": proj_folder,
93 "project_folder_path": full_proj_path,
94 "last_modified": os.stat(full_proj_path).st_mtime,
95 "port" : project_port
96 }
97 )
98
99 # order by last_modified (descending)
100 projects.sort(key=lambda x: x["last_modified"], reverse=True)
101 return jsonify(projects)
102
103
104@app.route("/api/projects/<id>", methods=["GET"])

Callers

nothing calls this directly

Calls 2

get_launcher_stateFunction · 0.90
get_project_portFunction · 0.90

Tested by

no test coverage detected