fix:修改脚本
This commit is contained in:
@@ -17,12 +17,13 @@ if ! ss -tlnp 2>/dev/null | grep -q ":$PORT "; then
|
||||
fi
|
||||
fi
|
||||
echo "--- 测试 API ---"
|
||||
# 独立后端路由为 /config(无 /api 前缀),Nginx 反代后浏览器请求 /api/config
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
resp=$(curl -s -o /dev/null -w "%{http_code}" "http://127.0.0.1:${PORT}/api/config" 2>/dev/null)
|
||||
resp=$(curl -s -o /dev/null -w "%{http_code}" "http://127.0.0.1:${PORT}/config" 2>/dev/null)
|
||||
if [ "$resp" = "200" ]; then
|
||||
echo "GET /api/config 返回 200,服务正常。"
|
||||
echo "GET /config 返回 200,服务正常。"
|
||||
else
|
||||
echo "GET /api/config 返回 ${resp},请检查服务。"
|
||||
echo "GET /config 返回 ${resp},请检查服务。"
|
||||
fi
|
||||
else
|
||||
echo "未安装 curl,仅检查了端口监听。"
|
||||
|
||||
Reference in New Issue
Block a user