Skip to content

Health Check

The health check endpoint allows you to verify that the API server is running and responding to requests.

Endpoint

HEAD /health-check
GET /health-check

Description

This endpoint is used for monitoring and load balancer health checks. It returns a simple status response indicating that the server is operational.

Request

HEAD Request

The HEAD method returns only the HTTP status code without a response body, making it ideal for health checks.

Request Example:

curl -I https://api.luxmart.site/health-check

Response:

HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8

GET Request

The GET method returns a JSON response with the status.

Request Example:

curl https://api.luxmart.site/health-check

Response

Success Response (200 OK)

Status Code: 200 OK

Response Body (GET only):

{
  "status": "ok"
}

Response Headers:

HTTP/1.1 200 OK
Content-Type: application/json

Authentication

This endpoint does not require authentication.

Use Cases

  • Load Balancer Health Checks: Configure your load balancer to check this endpoint
  • Monitoring Systems: Use this endpoint to monitor API availability
  • CI/CD Pipelines: Verify API is running after deployments
  • Service Discovery: Check if the service is ready to accept requests

Example Usage

Using curl (HEAD)

curl -I https://api.luxmart.site/health-check

Using curl (GET)

curl https://api.luxmart.site/health-check

Using JavaScript (Fetch API)

// HEAD request
fetch('https://api.luxmart.site/health-check', {
  method: 'HEAD'
})
  .then(response => {
    if (response.ok) {
      console.log('API is healthy');
    }
  });

// GET request
fetch('https://api.luxmart.site/health-check')
  .then(response => response.json())
  .then(data => {
    console.log('Status:', data.status);
  });

Notes

  • The endpoint responds quickly without performing any database queries or heavy operations
  • Both HEAD and GET methods return the same status code (200 OK)
  • The endpoint is always available, even if other API endpoints are experiencing issues
  • No rate limiting is applied to this endpoint