GET /api/health
Returns the health status of the DefDrive API server. This endpoint is useful for monitoring, load balancer health checks, and verifying that the server is running.Authentication
This endpoint does not require authentication.Response
Always returns
"ok" when the server is operationalExample request
Example response
Use cases
Load balancer checks
Configure your load balancer to ping this endpoint to verify server health
Monitoring systems
Set up monitoring tools to poll this endpoint and alert on failures
Container orchestration
Use as a liveness/readiness probe in Kubernetes or Docker Swarm
CI/CD validation
Verify deployment success by checking health after deployment
Docker health check
This endpoint is used in Docker Compose health checks:docker-compose.yml
Kubernetes probe
Use this endpoint for Kubernetes liveness and readiness probes:deployment.yaml
Implementation
This endpoint is implemented inroutes/routes.go:69-72 as a simple anonymous function that returns a JSON response with status: "ok".
The health check only verifies that the HTTP server is responding. It does not check database connectivity or other service dependencies. Consider implementing a more comprehensive health check endpoint for production monitoring.