File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55node server.js &
66SERVER_PID=$!
77
8- # Wait for the server to be ready
9- echo " Waiting for Next.js server to start..."
10- for i in $( seq 1 30) ; do
11- if wget -q -S --spider http://localhost:3000/ 2>&1 | grep -q " HTTP/" ; then
12- echo " Server is up, starting warmup..."
13- break
14- fi
15- if [ " $i " = " 30" ]; then
16- echo " Server failed to start within 30s"
17- exit 1
18- fi
19- sleep 1
20- done
21-
228# Warmup key pages to trigger SSR compilation and caching
239echo " Warming up pages..."
2410wget -q -O /dev/null http://localhost:3000/zh-CN 2> /dev/null || true
2511wget -q -O /dev/null http://localhost:3000/zh-CN/search 2> /dev/null || true
2612wget -q -O /dev/null http://localhost:3000/en 2> /dev/null || true
13+ wget -q -O /dev/null http://localhost:3000/en/search 2> /dev/null || true
2714echo " Warmup complete."
2815
2916# Wait for the server process
You can’t perform that action at this time.
0 commit comments