21 lines
477 B
Bash
21 lines
477 B
Bash
#!/bin/bash
|
|
|
|
# 切换 Node.js 版本
|
|
nvm use v22.18.0
|
|
|
|
# 激活 Python 虚拟环境
|
|
source backend/venv/bin/activate
|
|
|
|
# 启动前端 (后台运行,日志写入 frontend.log)
|
|
cd frontend
|
|
nohup npm run dev > ../frontend.log 2>&1 &
|
|
|
|
# 启动后端 (后台运行,日志写入 backend.log)
|
|
cd ../backend
|
|
nohup python3 app/main.py > ../backend.log 2>&1 &
|
|
|
|
# 提示
|
|
echo "前端和后端已经在后台启动!"
|
|
echo "前端日志: frontend.log"
|
|
echo "后端日志: backend.log"
|