How to run ngrok in background?

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.

Configure ngrok’s CORS headers

I just stumbled across this issue today and was able to resolve it by starting ngrok and including the –host-header flag. ngrok http –host-header=rewrite 3000 From the docs: Use the –host-header switch to rewrite incoming HTTP requests. If rewrite is specified, the Host header will be rewritten to match the hostname portion of the forwarding … Read more