()
| 76 | |
| 77 | @app.route("/api/projects", methods=["GET"]) |
| 78 | def 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"]) |
nothing calls this directly
no test coverage detected