#!/bin/bash echo "Testing chat functionality on localhost:3000" echo "=============================================" echo "" # Test 1: Check if webui is accessible echo "1. Checking if webui is accessible..." WEBUI_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000) if [ "$WEBUI_STATUS" = "200" ]; then echo "✓ Webui is accessible (HTTP $WEBUI_STATUS)" else echo "✗ Webui returned HTTP $WEBUI_STATUS" exit 1 fi echo "" # Test 2: Check API Gateway health echo "2. Checking API Gateway health..." API_HEALTH=$(curl -s http://localhost:3015/health 2>&1) echo "API Gateway response: $API_HEALTH" echo "" # Test 3: Try to send a chat message echo "3. Testing chat API endpoint..." CHAT_RESPONSE=$(curl -s -X POST http://localhost:3015/api/chat \ -H "Content-Type: application/json" \ -d '{"message": "Привет, как дела?", "chatId": "test-'$(date +%s)'"}' \ 2>&1) echo "Chat API response:" echo "$CHAT_RESPONSE" echo "" # Test 4: Check chat-svc directly echo "4. Checking chat-svc health..." CHAT_HEALTH=$(curl -s http://localhost:3005/health 2>&1) echo "Chat service response: $CHAT_HEALTH" echo "" echo "=============================================" echo "Test complete!"