mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user