ajuste ip

This commit is contained in:
NANDO9322 2026-01-08 20:37:07 -03:00
parent 8abb65ad02
commit a199438e53

View file

@ -107,15 +107,6 @@ func NewRouter() http.Handler {
applicationHandler := handlers.NewApplicationHandler(applicationService)
paymentHandler := handlers.NewPaymentHandler(credentialsService)
// --- IP HELPER ---
GetClientIP := func(r *http.Request) string {
forwarded := r.Header.Get("X-Forwarded-For")
if forwarded != "" {
return forwarded
}
return r.RemoteAddr
}
// --- HEALTH CHECK ---
mux.HandleFunc("GET /health", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
@ -132,7 +123,6 @@ func NewRouter() http.Handler {
response := map[string]interface{}{
"message": "🐴 GoHorseJobs API is running!",
"ip": GetClientIP(r),
"docs": "/docs",
"health": "/health",
"version": "1.0.0",