diff --git a/supabase/chatai-ui/wrapper.sh b/supabase/chatai-ui/wrapper.sh index b3d3bef..ff942b7 100644 --- a/supabase/chatai-ui/wrapper.sh +++ b/supabase/chatai-ui/wrapper.sh @@ -1,14 +1,14 @@ #!/bin/bash -set -e +set -euo pipefail -# --- 等待 Kong 代理接口可用(假设它暴露在 127.0.0.1:8000)--- -echo "[chatai-ui] Waiting for Kong to be ready at http://localhost:8000/..." -until curl -sSf http://localhost:8000/ > /dev/null; do - echo "[chatai-ui] Kong not ready yet, retrying..." +echo "[chatai-ui] Waiting for Kong to proxy PostgREST..." + +until curl -sSf http://localhost:8000/rest/v1/health > /dev/null 2>&1; do + echo "[chatai-ui] Still waiting for API route /rest/v1/health..." sleep 1 done -echo "[chatai-ui] Kong is ready." -# --- 切换到项目目录并启动 next.js --- +echo "[chatai-ui] API is reachable via Kong. Starting UI..." + cd /supabase/chatai-ui exec npm run start