ajuste ip
This commit is contained in:
parent
8abb65ad02
commit
a199438e53
1 changed files with 0 additions and 10 deletions
|
|
@ -107,15 +107,6 @@ func NewRouter() http.Handler {
|
||||||
applicationHandler := handlers.NewApplicationHandler(applicationService)
|
applicationHandler := handlers.NewApplicationHandler(applicationService)
|
||||||
paymentHandler := handlers.NewPaymentHandler(credentialsService)
|
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 ---
|
// --- HEALTH CHECK ---
|
||||||
mux.HandleFunc("GET /health", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("GET /health", func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
|
@ -132,7 +123,6 @@ func NewRouter() http.Handler {
|
||||||
|
|
||||||
response := map[string]interface{}{
|
response := map[string]interface{}{
|
||||||
"message": "🐴 GoHorseJobs API is running!",
|
"message": "🐴 GoHorseJobs API is running!",
|
||||||
"ip": GetClientIP(r),
|
|
||||||
"docs": "/docs",
|
"docs": "/docs",
|
||||||
"health": "/health",
|
"health": "/health",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue