#!/bin/bash # Test Backend Only - Visual Workflow Builder echo "๐Ÿงช Testing Visual Workflow Builder Backend..." echo "" cd backend # Check if venv exists if [ ! -d "venv" ]; then echo "Creating virtual environment..." python3 -m venv venv fi # Activate venv source venv/bin/activate # Install dependencies echo "Installing dependencies..." pip install -q -r requirements.txt # Create .env if it doesn't exist if [ ! -f ".env" ]; then cp .env.example .env fi # Start server in background echo "Starting backend server..." python app.py & SERVER_PID=$! # Wait for server to start sleep 3 # Test health endpoint echo "" echo "Testing health endpoint..." RESPONSE=$(curl -s http://localhost:5001/health) if [ $? -eq 0 ]; then echo "โœ… Backend is running!" echo "Response: $RESPONSE" echo "" echo "Available endpoints:" echo " - http://localhost:5001/health" echo " - http://localhost:5001/api/workflows" echo " - http://localhost:5001/api/templates" echo " - http://localhost:5001/api/node-types" echo " - http://localhost:5001/api/executions" else echo "โŒ Backend failed to start" fi # Cleanup echo "" echo "Stopping server..." kill $SERVER_PID 2>/dev/null echo "โœ… Test complete!"