1proxy / run.py
paijo77's picture
update run.py
66961f6 verified
#!/usr/bin/env python3
"""
Simple entry point to run the 1proxy backend server.
Usage: python run.py
"""
import os
from pathlib import Path
# Load environment variables from .env file
try:
from dotenv import load_dotenv
env_path = Path(__file__).parent / '.env'
load_dotenv(dotenv_path=env_path)
print(f"βœ… Loaded environment from: {env_path}")
except ImportError:
print("⚠️ python-dotenv not installed. Install with: pip install python-dotenv")
except Exception as e:
print(f"⚠️ Could not load .env file: {e}")
if __name__ == "__main__":
import uvicorn
print("πŸš€ Starting 1proxy Backend Server...")
print("🌐 Server will be available at: http://localhost:8000")
print("πŸ“š API Documentation: http://localhost:8000/docs")
print("")
# Run the FastAPI app with hot reload
uvicorn.run(
"app.main:app",
host="0.0.0.0",
port=8000,
reload=True,
log_level="info"
)