Configure API server endpoints for iOS/Android development builds
Updated scripts/common.sh to set appropriate API server endpoints based on build mode: - Development: localhost:3000 for Endorser API, production for Image/Partner APIs - Test: test-api.endorser.ch for Endorser API, production for Image/Partner APIs - Production: All production endpoints This ensures mobile builds use correct API endpoints for each environment while keeping Image and Partner APIs on production servers for dev/test.
This commit is contained in:
@@ -195,10 +195,31 @@ setup_build_env() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Set API server environment variables based on build mode
|
||||||
|
if [ "$BUILD_MODE" = "development" ]; then
|
||||||
|
export VITE_DEFAULT_ENDORSER_API_SERVER="http://localhost:3000"
|
||||||
|
export VITE_DEFAULT_IMAGE_API_SERVER="https://image-api.timesafari.app"
|
||||||
|
export VITE_DEFAULT_PARTNER_API_SERVER="https://partner-api.endorser.ch"
|
||||||
|
log_debug "Development mode: Using localhost for Endorser API, production for Image/Partner APIs"
|
||||||
|
elif [ "$BUILD_MODE" = "test" ]; then
|
||||||
|
export VITE_DEFAULT_ENDORSER_API_SERVER="https://test-api.endorser.ch"
|
||||||
|
export VITE_DEFAULT_IMAGE_API_SERVER="https://image-api.timesafari.app"
|
||||||
|
export VITE_DEFAULT_PARTNER_API_SERVER="https://partner-api.endorser.ch"
|
||||||
|
log_debug "Test mode: Using test Endorser API, production for Image/Partner APIs"
|
||||||
|
elif [ "$BUILD_MODE" = "production" ]; then
|
||||||
|
export VITE_DEFAULT_ENDORSER_API_SERVER="https://api.endorser.ch"
|
||||||
|
export VITE_DEFAULT_IMAGE_API_SERVER="https://image-api.timesafari.app"
|
||||||
|
export VITE_DEFAULT_PARTNER_API_SERVER="https://partner-api.endorser.ch"
|
||||||
|
log_debug "Production mode: Using production API servers"
|
||||||
|
fi
|
||||||
|
|
||||||
# Log environment setup
|
# Log environment setup
|
||||||
log_debug "Environment variables set:"
|
log_debug "Environment variables set:"
|
||||||
log_debug " VITE_PLATFORM=$VITE_PLATFORM"
|
log_debug " VITE_PLATFORM=$VITE_PLATFORM"
|
||||||
log_debug " DEBUG_MIGRATIONS=$DEBUG_MIGRATIONS"
|
log_debug " DEBUG_MIGRATIONS=$DEBUG_MIGRATIONS"
|
||||||
|
log_debug " VITE_DEFAULT_ENDORSER_API_SERVER=$VITE_DEFAULT_ENDORSER_API_SERVER"
|
||||||
|
log_debug " VITE_DEFAULT_IMAGE_API_SERVER=$VITE_DEFAULT_IMAGE_API_SERVER"
|
||||||
|
log_debug " VITE_DEFAULT_PARTNER_API_SERVER=$VITE_DEFAULT_PARTNER_API_SERVER"
|
||||||
if [ -n "$NODE_ENV" ]; then
|
if [ -n "$NODE_ENV" ]; then
|
||||||
log_debug " NODE_ENV=$NODE_ENV"
|
log_debug " NODE_ENV=$NODE_ENV"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user