-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtunnel.sh
More file actions
executable file
·34 lines (27 loc) · 868 Bytes
/
Copy pathtunnel.sh
File metadata and controls
executable file
·34 lines (27 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
#MISE description="Start dev server with Cloudflare Tunnel (requires setup:tunnel first)"
set -euo pipefail
# Start Cloudflare Tunnel in the background
echo "Starting Cloudflare Tunnel..."
cloudflared tunnel --config .cloudflared/config.yml run &
TUNNEL_PID=$!
# Wait for tunnel to be ready
echo "Waiting for tunnel to start..."
sleep 3
echo ""
echo "✅ Tunnel running at: https://tunnel.cambeerfestival.app"
echo ""
echo "Starting Flutter dev server on http://localhost:8080"
echo "Press Ctrl+C to stop both services."
echo ""
# Cleanup function
cleanup() {
echo ""
echo "Stopping tunnel..."
kill $TUNNEL_PID 2>/dev/null
exit
}
# Set up cleanup on exit
trap cleanup EXIT INT TERM
# Run Flutter in foreground without debug client (prevents WebSocket errors through tunnel)
flutter run -d web-server --web-port 8080 --no-injected-client