45 lines
1.2 KiB
Bash
45 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
echo "🧪 Testing Portal Environment Configuration"
|
|
echo "=========================================="
|
|
|
|
# Check if .env file exists
|
|
if [ -f ".env" ]; then
|
|
echo "✅ .env file found"
|
|
echo "📄 Contents:"
|
|
cat .env
|
|
echo ""
|
|
else
|
|
echo "❌ .env file not found"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if Trunk.toml exists and has env = true
|
|
if [ -f "Trunk.toml" ]; then
|
|
echo "✅ Trunk.toml found"
|
|
if grep -q "env = true" Trunk.toml; then
|
|
echo "✅ Environment variable support enabled in Trunk.toml"
|
|
else
|
|
echo "❌ Environment variable support not enabled in Trunk.toml"
|
|
echo "💡 Add 'env = true' to your Trunk.toml"
|
|
fi
|
|
echo ""
|
|
else
|
|
echo "❌ Trunk.toml not found"
|
|
fi
|
|
|
|
# Test environment variable
|
|
echo "🔍 Testing PORTAL_API_KEY environment variable:"
|
|
if [ -n "$PORTAL_API_KEY" ]; then
|
|
echo "✅ PORTAL_API_KEY is set: $PORTAL_API_KEY"
|
|
else
|
|
echo "❌ PORTAL_API_KEY is not set"
|
|
echo "💡 Run: export PORTAL_API_KEY=dev_key_123"
|
|
fi
|
|
|
|
echo ""
|
|
echo "🚀 To test the portal with proper environment setup:"
|
|
echo "1. export PORTAL_API_KEY=dev_key_123"
|
|
echo "2. trunk serve --open"
|
|
echo ""
|
|
echo "🔧 Check browser console for debugging logs when making requests" |