-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_server.py
More file actions
35 lines (27 loc) · 878 Bytes
/
start_server.py
File metadata and controls
35 lines (27 loc) · 878 Bytes
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
35
#!/usr/bin/env python3
import sys
import os
from dotenv import load_dotenv
# Load environment variables from .env
load_dotenv()
# Add current directory to path for module imports
sys.path.insert(0, os.path.dirname(__file__))
print("Starting KG-RAG Server...")
print("Python version:", sys.version)
try:
print("Importing FastAPI...")
import fastapi
print("✓ FastAPI imported")
print("Importing uvicorn...")
import uvicorn
print("✓ Uvicorn imported")
print("Importing application...")
from medigraphrag_x.api.app import app
print("✓ Application imported successfully")
print("Launching server on http://0.0.0.0:8004 (Press Ctrl+C to stop)")
uvicorn.run(app, host="0.0.0.0", port=8004, reload=False)
except Exception as e:
print(f"❌ Startup error: {e}")
import traceback
traceback.print_exc()
sys.exit(1)