Files
Phx-Yuri/health_check2.sh
2024-05-12 07:39:55 +00:00

11 lines
366 B
Bash
Executable File

#!/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- --connect-timeout=2 --server-response "$HEALTH_ENDPOINT" 2>&1 | awk '/^HTTP/{print $2}')
# Display the HTTP status code from the response
echo "HTTP status code: $response"