Files
ipinfo/healthcheck/healthcheck.go
T
2025-02-28 21:46:06 +00:00

25 lines
386 B
Go

package main
import (
"fmt"
"log"
"net/http"
"os"
)
func main() {
resp, err := http.Get("http://localhost:3000/health")
if err != nil {
log.Fatalf("Error performing health check: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
log.Printf("Health check failed: Status code %d", resp.StatusCode)
os.Exit(1)
}
fmt.Println("OK")
os.Exit(0)
}