- 从服务器拉取完整代码 - 按框架规范整理项目结构 - 配置 Drone CI 测试环境部署 - 包含后端(FastAPI)、前端(Vue3)、管理端 技术栈: Vue3 + TypeScript + FastAPI + MySQL
29 lines
739 B
Python
Executable File
29 lines
739 B
Python
Executable File
#!/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"
|
|
)
|