Skip to main content
The /health endpoint provides a simple health check to verify that the Surge server is running and accepting requests.

Endpoint

GET /health

Authentication

This endpoint does not require authentication.

Parameters

No parameters required.

Response

status
string
Health status - always returns "ok" when the server is running
port
integer
The port number the server is listening on

Example Request

curl http://localhost:1700/health

Example Response

{
  "status": "ok",
  "port": 1700
}

Status Codes

CodeDescription
200Server is healthy and running

Use Cases

  • Monitoring: Use in health check scripts or monitoring systems to verify the server is running
  • Load Balancers: Configure load balancers to use this endpoint for health checks
  • Container Orchestration: Use as a liveness/readiness probe in Docker or Kubernetes
  • Startup Verification: Verify the server has started successfully before sending other requests

Example: Health Check Script

#!/bin/bash
# health-check.sh - Verify Surge server is running

SURGE_HOST=${SURGE_HOST:-localhost:1700}

if curl -sf "http://$SURGE_HOST/health" > /dev/null; then
  echo "✓ Surge server is healthy"
  exit 0
else
  echo "✗ Surge server is not responding"
  exit 1
fi
  • List - Check download status
  • Events - Monitor server events