33 lines
788 B
Python
33 lines
788 B
Python
|
#!/usr/bin/env python3
|
||
|
"""
|
||
|
TYCM AI Review Service 启动脚本
|
||
|
"""
|
||
|
|
||
|
import sys
|
||
|
import uvicorn
|
||
|
from app.main import app
|
||
|
|
||
|
def main():
|
||
|
"""启动服务"""
|
||
|
print("=" * 60)
|
||
|
print("🚀 TYCM AI Review Service 正在启动...")
|
||
|
print("📖 API文档: http://localhost:8081/docs")
|
||
|
print("🔗 健康检查: http://localhost:8081/api/v1/health")
|
||
|
print("=" * 60)
|
||
|
|
||
|
try:
|
||
|
uvicorn.run(
|
||
|
"app.main:app", # 使用导入字符串而不是app对象
|
||
|
host="0.0.0.0",
|
||
|
port=8081,
|
||
|
reload=True,
|
||
|
log_level="info"
|
||
|
)
|
||
|
except KeyboardInterrupt:
|
||
|
print("\n👋 服务已停止")
|
||
|
except Exception as e:
|
||
|
print(f"❌ 启动失败: {e}")
|
||
|
sys.exit(1)
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|