From b88a65d9d7e756d766aff31bc0731c0faafd2c8c Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 31 Oct 2025 14:15:48 -0400 Subject: [PATCH] fix: API endpoint test script now reads API_PORT from .env - Read API_PORT from .env file if it exists - Construct API_BASE_URL using configured port - Display which URL is being tested - Consistent with validate_docker_build.sh behavior --- scripts/test_api_endpoints.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/test_api_endpoints.sh b/scripts/test_api_endpoints.sh index 6228f75..9023f77 100755 --- a/scripts/test_api_endpoints.sh +++ b/scripts/test_api_endpoints.sh @@ -17,9 +17,18 @@ BLUE='\033[0;34m' NC='\033[0m' # Configuration -API_BASE_URL=${API_BASE_URL:-http://localhost:8080} +# Read API_PORT from .env if available +API_PORT=${API_PORT:-8080} +if [ -f .env ]; then + export $(grep "^API_PORT=" .env | xargs) +fi +API_PORT=${API_PORT:-8080} + +API_BASE_URL=${API_BASE_URL:-http://localhost:$API_PORT} TEST_CONFIG="/app/configs/default_config.json" +echo "Using API base URL: $API_BASE_URL" + # Check if API is running echo "Checking if API is accessible..." if ! curl -f "$API_BASE_URL/health" &> /dev/null; then