Skip to content

Instantly share code, notes, and snippets.

@jesherdevsk8
Last active June 9, 2025 15:40
Show Gist options
  • Save jesherdevsk8/1c9bef15240c253a792b9c73ff5ada1d to your computer and use it in GitHub Desktop.
Save jesherdevsk8/1c9bef15240c253a792b9c73ff5ada1d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
## token link https://dashboard.ngrok.com/get-started/your-authtoken
## ngrok config add-authtoken xxxxxxxxxxxxxxxxxxxxxxxxxxx
pServer() {
python3 -m http.server 8010 &
pid=$!
echo "PID: $pid"
}
nGrok() {
if command -v ngrok &> /dev/null; then
pServer
sleep 3
ngrok http 8010
else
echo "error: ngrok não instalado"
fi
}
main() {
nGrok
kill -9 "$pid"
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment