#!/usr/bin/env python3
"""
Local development server runner.
"""
import os
import sys

if __name__ == "__main__":
    port = int(os.getenv("PORT", 8000))
    print(f"🚀 Starting server on port {port}")
    print(f"📍 Backend: http://localhost:{port}")
    print(f"🔌 WebSocket: ws://localhost:{port}/ws")
    print("")
    
    # Use import string format for reload to work properly
    try:
        import uvicorn
        uvicorn.run("backend.server:app", host="0.0.0.0", port=port, reload=True)
    except Exception as e:
        print(f"❌ Error: {e}")
        print("💡 Make sure uvicorn is installed: pip install 'uvicorn[standard]'")
        sys.exit(1)

