-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
45 lines (36 loc) · 1.05 KB
/
start-dev.sh
File metadata and controls
45 lines (36 loc) · 1.05 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
echo "🎬 Iniciando Movie Manager - Full Stack Application"
echo "=================================================="
# Check if MongoDB is running
if ! pgrep -x "mongod" > /dev/null; then
echo "⚠️ Advertencia: MongoDB no parece estar ejecutándose."
echo " Asegúrate de iniciar MongoDB antes de continuar."
echo ""
fi
# Function to cleanup processes on script exit
cleanup() {
echo ""
echo "🛑 Deteniendo servidores..."
kill $BACKEND_PID $FRONTEND_PID 2>/dev/null
exit 0
}
# Set trap to cleanup on script exit
trap cleanup SIGINT SIGTERM
# Start backend
echo "🚀 Iniciando backend en puerto 3000..."
npm start &
BACKEND_PID=$!
# Wait a moment for backend to start
sleep 3
# Start frontend
echo "🎨 Iniciando frontend en puerto 3001..."
cd frontend && npm start &
FRONTEND_PID=$!
echo ""
echo "✅ Aplicación iniciada exitosamente!"
echo " Backend: http://localhost:3000"
echo " Frontend: http://localhost:3001"
echo ""
echo "Presiona Ctrl+C para detener ambos servidores"
# Wait for both processes
wait