ngrok running in background

as explained here

ngrok -log=stdout 80 > /dev/null &

as described previously you can run ngrok in background with

./ngrok http 8080 > /dev/null &

next you can use curl and for example jq a command-line JSON processor.

export WEBHOOK_URL="$(curl http://localhost:4040/api/tunnels | jq ".tunnels[0].public_url")"

your URL will be accessible from $WEBHOOK_URL env variable and you can use it anywhere.


Visit http://localhost:4040/status on your local machine, or see more here: View random ngrok URL when run in background.

Tags:

Terminal

Ngrok