mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-11 13:17:23 -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'
|
NC='\033[0m'
|
||||||
|
|
||||||
# Configuration
|
# 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"
|
TEST_CONFIG="/app/configs/default_config.json"
|
||||||
|
|
||||||
|
echo "Using API base URL: $API_BASE_URL"
|
||||||
|
|
||||||
# Check if API is running
|
# Check if API is running
|
||||||
echo "Checking if API is accessible..."
|
echo "Checking if API is accessible..."
|
||||||
if ! curl -f "$API_BASE_URL/health" &> /dev/null; then
|
if ! curl -f "$API_BASE_URL/health" &> /dev/null; then
|
||||||
|
|||||||
Reference in New Issue
Block a user