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
This commit is contained in:
2025-10-31 14:15:48 -04:00
parent 71829918ca
commit b88a65d9d7

View File

@@ -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