first commit

This commit is contained in:
2024-05-12 07:39:55 +00:00
commit 16c2cb854e
139 changed files with 14931 additions and 0 deletions

28
health_check.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Define the URL of your health endpoint
HEALTH_ENDPOINT="http://localhost:3000/health"
# Make a GET request to the health endpoint and capture the response
RESPONSE=$(wget -qO- --timeout=2 "$HEALTH_ENDPOINT" )
# Display the response from the health endpoint
echo "Response from health endpoint: $RESPONSE"
# Extract the value of the "status" field using jq
status=$(echo "$RESPONSE" | jq -r '.status')
# Check if the status is "ok"
if [[ "$status" == "ok" ]]; then
echo "Health check successful"
exit 0 # Exit with success status
else
echo "Health check failed"
exit 1 # Exit with failure status
fi
# if [[ "$RESPONSE" =~ '"status": "ok"' ]]; then
# echo "Health check successful"
# exit 0 # Exit with success status
# else
# echo "Health check failed: $RESPONSE"
# exit 1 # Exit with failure status
# fi