import requests for port in [3000, 3001]: try: r = requests.get(f"http://localhost:{port}/api/config", timeout=2) print(f"Port {port} /api/config: {r.status_code}") except Exception as e: print(f"Port {port}: failed ({e})")