#!/usr/bin/env python3
"""简单启动脚本，避免配置问题"""
import os
import sys

# 设置Python路径
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

# 导入local_config来设置环境变量
import local_config

if __name__ == "__main__":
    import uvicorn
    
    # 确保CORS_ORIGINS格式正确
    os.environ["CORS_ORIGINS"] = '["http://localhost:3000","http://localhost:3001","http://localhost:5173"]'
    
    print("🚀 启动后端服务...")
    print("📚 API文档: http://localhost:8000/docs")
    print("🔍 健康检查: http://localhost:8000/health")
    
    uvicorn.run(
        "app.main:app",
        host="0.0.0.0",
        port=8000,
        reload=True,
        log_level="info"
    )
