-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-tunnels.sh
More file actions
executable file
·53 lines (42 loc) · 1.07 KB
/
start-tunnels.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.07 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
echo "Starting NodeDeck with tunnels..."
# Start the server
echo "Starting server..."
cd nodedeck-server
npm start &
SERVER_PID=$!
# Wait for server to start
sleep 3
# Start server tunnel
echo "Starting server tunnel..."
npx localtunnel --port 3000 --subdomain nodedeck-server &
SERVER_TUNNEL_PID=$!
# Start client preview
echo "Starting client..."
cd ../nodedeck-client
npm run build
npm run preview &
CLIENT_PID=$!
# Wait for client to start
sleep 3
# Start client tunnel
echo "Starting client tunnel..."
npx localtunnel --port 4173 --subdomain nodedeck-client &
CLIENT_TUNNEL_PID=$!
echo ""
echo "🚀 NodeDeck is running!"
echo "📱 Client: https://nodedeck-client.loca.lt"
echo "🖥️ Server: https://nodedeck-server.loca.lt"
echo ""
echo "Use server URL in client: https://nodedeck-server.loca.lt"
echo ""
echo "Press Ctrl+C to stop all services"
# Function to cleanup on exit
cleanup() {
echo "Stopping all services..."
kill $SERVER_PID $SERVER_TUNNEL_PID $CLIENT_PID $CLIENT_TUNNEL_PID 2>/dev/null
exit
}
trap cleanup INT
# Wait for user to stop
wait