This commit is contained in:
Chu Văn Hải committed 2025-12-05 11:18:26 +07:00
commit fb6af905cd
30 files changed
+8653

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
set -e # Thoát ngay lập tức nếu có lệnh nào thất bại
echo "Checking /health endpoint..."
health_status=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/health")
if [ "$health_status" -eq 200 ] || [ "$health_status" -eq 404 ]; then
echo "/health check passed with status ${health_status}"
exit 0
fi
echo "/health check failed with status ${health_status}. Checking / endpoint..."
root_status=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT}/")
if [ "$root_status" -eq 200 ] || [ "$root_status" -eq 404 ]; then
echo "/ check passed with status ${root_status}"
exit 0
fi
echo "/ check failed with status ${root_status}. Health check failed overall."
exit 1