File size: 713 Bytes
a25386c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/usr/bin/env python3
import requests
import json
import sys
try:
# Test health check
print("Testing health check endpoint...")
response = requests.get('http://localhost:3000/', timeout=2)
if response.status_code == 200:
data = response.json()
print("β
Server is running!")
print("π Response:")
print(json.dumps(data, indent=2))
else:
print(f"β Error: {response.status_code}")
except requests.exceptions.ConnectionError:
print("β Could not connect to server at http://localhost:3000")
print("π‘ Tip: Start the server with: python3 server.py")
sys.exit(1)
except Exception as e:
print(f"β Error: {str(e)}")
sys.exit(1)
|