#!/bin/bash # Quick Test - Visual Workflow Builder Backend on Port 5001 echo "đŸ§Ș Test Rapide du Backend (Port 5001)..." echo "" cd backend # VĂ©rifier si le venv existe if [ ! -d "venv" ]; then echo "❌ Environnement virtuel non trouvĂ©" echo "ExĂ©cutez d'abord: python3 -m venv venv" exit 1 fi # Activer venv source venv/bin/activate # VĂ©rifier si les dĂ©pendances sont installĂ©es if ! python -c "import flask" 2>/dev/null; then echo "📩 Installation des dĂ©pendances..." pip install -q -r requirements.txt fi # CrĂ©er .env si nĂ©cessaire if [ ! -f ".env" ]; then cp .env.example .env echo "✅ Fichier .env créé" fi # DĂ©marrer le serveur en arriĂšre-plan echo "🚀 DĂ©marrage du serveur sur le port 5001..." python app.py > /dev/null 2>&1 & SERVER_PID=$! # Attendre que le serveur dĂ©marre sleep 3 # Tester le endpoint health echo "🔍 Test du endpoint /health..." RESPONSE=$(curl -s http://localhost:5001/health 2>/dev/null) if [ $? -eq 0 ] && [ ! -z "$RESPONSE" ]; then echo "✅ Backend fonctionne correctement!" echo "" echo "📊 RĂ©ponse: $RESPONSE" echo "" echo "🌐 Endpoints disponibles:" echo " ‱ Health: http://localhost:5001/health" echo " ‱ Workflows: http://localhost:5001/api/workflows" echo " ‱ Templates: http://localhost:5001/api/templates" echo " ‱ Node Types: http://localhost:5001/api/node-types" echo " ‱ Executions: http://localhost:5001/api/executions" echo "" echo "✅ Le port 5001 est maintenant utilisĂ© (au lieu de 5000)" else echo "❌ Échec de connexion au serveur" echo "" echo "VĂ©rifiez que le port 5001 est libre:" echo " lsof -i :5001" fi # ArrĂȘter le serveur echo "" echo "🛑 ArrĂȘt du serveur..." kill $SERVER_PID 2>/dev/null wait $SERVER_PID 2>/dev/null echo "✅ Test terminĂ©!"