Skip to main content
GET
/
health
curl -X GET "http://localhost:8080/health" \
  -H "Content-Type: application/json"
{
  "status": "healthy",
  "service": "supabase-auth-service",
  "version": "1.0.0",
  "timestamp": "2025-05-30T00:00:00Z"
}
Returns the current health status of the Strike Auth Service. This endpoint is useful for monitoring, load balancers, and service discovery systems.
This endpoint does not require authentication and can be called by anyone.
curl -X GET "http://localhost:8080/health" \
  -H "Content-Type: application/json"

Response

status
string
Service health status. Always “healthy” when the service is operational.
service
string
Service name identifier.
version
string
Current version of the service.
timestamp
string
Current server timestamp in ISO 8601 format.
{
  "status": "healthy",
  "service": "supabase-auth-service",
  "version": "1.0.0",
  "timestamp": "2025-05-30T00:00:00Z"
}

Use Cases

Load Balancer Health Checks

Configure your load balancer to use this endpoint for health checks:
# Example Kubernetes liveness probe
livenessProbe:
  httpGet:
    path: /health
    port: 8080
  initialDelaySeconds: 30
  periodSeconds: 10

Service Discovery

Use this endpoint to verify service availability in service discovery systems:
// Example service discovery check
async function checkServiceHealth(serviceUrl) {
  try {
    const response = await fetch(`${serviceUrl}/health`);
    const health = await response.json();
    return health.status === 'healthy';
  } catch (error) {
    return false;
  }
}

Monitoring and Alerting

Monitor service health and set up alerts:
# Example monitoring script
#!/bin/bash
HEALTH_URL="http://localhost:8080/health"
RESPONSE=$(curl -s $HEALTH_URL)
STATUS=$(echo $RESPONSE | jq -r '.status')

if [ "$STATUS" != "healthy" ]; then
  echo "Service is unhealthy: $RESPONSE"
  # Send alert
  exit 1
fi

echo "Service is healthy"

Docker Health Checks

Use in Docker containers for health checking:
# Dockerfile example
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  CMD curl -f http://localhost:8080/health || exit 1

Response Time

This endpoint is designed to respond quickly (typically < 10ms) as it performs minimal processing:
  • No database queries
  • No external API calls
  • Simple status check only

Security Considerations

  • No Authentication Required: This endpoint is public by design
  • No Sensitive Information: Only basic service information is exposed
  • Rate Limiting: Standard rate limits apply to prevent abuse

Troubleshooting

If the health check fails:
  1. Service Not Running: Verify the service is started and listening on the correct port
  2. Network Issues: Check network connectivity and firewall rules
  3. Resource Constraints: Monitor CPU, memory, and disk usage
  4. Dependencies: Verify database and external service connectivity
I