Spaces:
Running
Running
| # Get the IP address | |
| IP=$(ipconfig getifaddr en0) | |
| if [ -z "$IP" ]; then | |
| # Try wifi interface if en0 doesn't work | |
| IP=$(ipconfig getifaddr en1) | |
| fi | |
| # Function to display the message at the bottom | |
| display_ip() { | |
| while true; do | |
| # Move to bottom of screen | |
| tput cup $(($(tput lines)-4)) 0 | |
| # Clear 4 lines | |
| tput el; echo | |
| tput el; echo -e "\033[33m🌐 Network Access URL for iOS:" | |
| tput el; echo -e "https://$IP:3000" | |
| tput el; echo -e "==========================================\033[0m" | |
| sleep 1 | |
| done | |
| } | |
| # Start the display in background | |
| display_ip & | |
| DISPLAY_PID=$! | |
| # Cleanup on script exit | |
| trap 'kill $DISPLAY_PID; tput cnorm; clear' EXIT | |
| # Start the React app with HTTPS and network access | |
| HTTPS=true HOST=0.0.0.0 react-scripts start |