mirror of
https://github.com/skidoodle/ipinfo.git
synced 2026-04-28 17:37:37 +02:00
add domain whois/dns support, refactor codebase
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// HealthCheck Returns a simple health check handler.
|
||||
func HealthCheck() http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, err := w.Write([]byte("OK"))
|
||||
if err != nil {
|
||||
slog.Warn("failed to write healthcheck response",
|
||||
"component", "healthcheck",
|
||||
"method", r.Method,
|
||||
"path", r.URL.Path,
|
||||
"error", err,
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user