56 lines
1.7 KiB
Python
56 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Quick script to check LightRAG server status and available endpoints
|
|
"""
|
|
|
|
import requests
|
|
import time
|
|
|
|
def check_server_status():
|
|
"""Check if LightRAG server is responding and list available endpoints"""
|
|
base_url = "http://localhost:3015"
|
|
|
|
print("🔍 Checking LightRAG Server Status")
|
|
print("=" * 50)
|
|
|
|
# Test basic connectivity
|
|
try:
|
|
response = requests.get(base_url, timeout=5)
|
|
print(f"✅ Root endpoint: {response.status_code}")
|
|
if response.status_code == 200:
|
|
print(f" Response: {response.text[:200]}...")
|
|
except Exception as e:
|
|
print(f"❌ Root endpoint: {e}")
|
|
|
|
# Test common endpoints
|
|
endpoints = [
|
|
"/api/health",
|
|
"/api/documents",
|
|
"/api/documents/pipeline_status",
|
|
"/api/search",
|
|
"/health",
|
|
"/docs"
|
|
]
|
|
|
|
for endpoint in endpoints:
|
|
try:
|
|
url = base_url + endpoint
|
|
response = requests.get(url, timeout=5)
|
|
print(f"✅ {endpoint}: {response.status_code}")
|
|
except Exception as e:
|
|
print(f"❌ {endpoint}: {e}")
|
|
|
|
# Test with API key
|
|
print("\n🔐 Testing with API Key...")
|
|
headers = {'X-API-Key': 'jleu1212'}
|
|
try:
|
|
response = requests.get(base_url + "/api/documents", headers=headers, timeout=5)
|
|
print(f"✅ /api/documents with API key: {response.status_code}")
|
|
if response.status_code == 200:
|
|
data = response.json()
|
|
print(f" Response: {data}")
|
|
except Exception as e:
|
|
print(f"❌ /api/documents with API key: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
check_server_status() |