-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiagnose_backend.py
More file actions
34 lines (28 loc) · 1.11 KB
/
diagnose_backend.py
File metadata and controls
34 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import requests
import sys
URL = "https://neel-uo71.onrender.com/"
DOCS = URL + "docs"
def check():
print(f"Checking NEEL Backend at : {URL}")
try:
r = requests.get(URL, timeout=10)
print(f"Root endpoint: {r.status_code}")
if r.status_code == 200:
data = r.json()
print(f"✅ Backend is reachable! Version: {data.get('version')}")
if data.get('version') == "1.0.3":
print("🌟 SUCCESS: Version 1.0.3 is LIVE!")
else:
print(f"⏳ Waiting for version 1.0.3 (Current: {data.get('version')})")
else:
print(f"❌ Backend returned error code: {r.status_code}")
d = requests.get(DOCS, timeout=10)
print(f"Docs endpoint: {d.status_code}")
h = requests.get(URL + "api/health", timeout=10)
print(f"Health endpoint: {h.status_code}")
if h.status_code == 200:
print(f"✅ Health Check PASSED: {h.json()}")
except Exception as e:
print(f"❌ Failed to reach backend: {str(e)}")
if __name__ == "__main__":
check()