-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
26 lines (20 loc) · 750 Bytes
/
Copy pathstart-dev.sh
File metadata and controls
26 lines (20 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# SnapSend 本地开发启动脚本 (Linux/macOS)
echo -e "\033[36mStarting SnapSend development servers...\033[0m"
cd "$(dirname "$0")"
# Backend
cd backend
CONFIG_PATH=../config.yaml uvicorn app.main:app --reload --port 8080 &
BACKEND_PID=$!
echo -e "\033[32mBackend started (PID $BACKEND_PID) at http://localhost:8080\033[0m"
echo -e "\033[90mAPI docs: http://localhost:8080/api/docs\033[0m"
sleep 2
# Frontend
cd ../frontend
NEXT_PUBLIC_API_URL=http://localhost:8080 npm run dev &
FRONTEND_PID=$!
echo -e "\033[32mFrontend started (PID $FRONTEND_PID) at http://localhost:3000\033[0m"
echo ""
echo "Press Ctrl+C to stop all servers"
trap "kill $BACKEND_PID $FRONTEND_PID 2>/dev/null; echo 'Servers stopped.'" SIGINT SIGTERM
wait