commit 76027efe73e4168550c4c82dfd5ca2a63c218692 parent 5b113cf169db63d6623830450fa9df906bdad9e5 Author: Henry Unite <unitehenry@gmail.com> Date: Sun, 8 Mar 2026 00:30:30 +0000 chore: ngrok script Diffstat:
| M | scripts/ngrok.sh | | | 17 | ++++++++--------- |
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/scripts/ngrok.sh b/scripts/ngrok.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash +# Start serve in background +scripts/serve.sh & +SERVE_PID=$! + +# Wait for server to be ready +sleep 2 + # Start ngrok in background ngrok http 3000 & NGROK_PID=$! @@ -7,18 +14,10 @@ NGROK_PID=$! # Wait for ngrok to be ready sleep 2 -# Start serve in background -scripts/serve.sh & -SERVE_PID=$! - # Configure via the tunnel curl -X POST \ "$(curl -s http://127.0.0.1:4040/api/tunnels | grep -oE 'https://[^"]+')/configure" \ - -d "{ - \"twilioAccountSid\": \"$TWILIO_ACCOUNT_SID\", - \"twilioPhoneNumberSid\": \"$TWILIO_PHONE_NUMBER_SID\", - \"twilioAuthToken\": \"$TWILIO_AUTH_TOKEN\"} - " + -d "twilioAccountSid=$TWILIO_ACCOUNT_SID&twilioPhoneNumberSid=$TWILIO_PHONE_NUMBER_SID&twilioAuthToken=$TWILIO_AUTH_TOKEN" # Trap to kill background processes on script exit trap "kill $NGROK_PID $SERVE_PID" EXIT