Expose your local development server to the internet via Cloudflare Quick Tunnel.
-
Check if
cloudflaredis installed. If not, install it:- macOS:
brew install cloudflared - Linux: Download from https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/
- macOS:
-
Detect which port the app is running on automatically (check running processes, recent terminal output, config files like
package.jsonscripts,docker-compose.yml, etc.). Only ask the user if you genuinely can't determine it. -
Start the tunnel:
cloudflared tunnel --url http://localhost:${PORT} -
Extract the generated public URL from the cloudflared output (it will be a
*.trycloudflare.comURL). -
Present the URL to the user clearly:
Your app is now live at: https://xxxxx.trycloudflare.com Share this URL with anyone -- it works on any device, any network. -
Print a celebrative ASCII art banner with the public URL prominently displayed in the center. Make it feel like a "launch moment" -- something the user will want to screenshot and share. Example vibe:
╔══════════════════════════════════════════════════════╗ ║ ║ ║ 🚀 YOUR APP IS LIVE ON THE INTERNET 🚀 ║ ║ ║ ║ https://xxxxx.trycloudflare.com ║ ║ ║ ║ Share this URL with anyone, anywhere. ║ ║ ║ ╚══════════════════════════════════════════════════════╝ -
Remind the user:
- The tunnel stays alive as long as this terminal is open
- The URL changes if you restart the tunnel
- For a permanent setup, see Part 2 of Ship It Free
- No Cloudflare account needed for Quick Tunnels
- HTTPS is automatic -- no certificate setup
- Works behind firewalls and NAT
- 200 concurrent request limit (fine for demos and feedback)