Spaces:
Paused
Paused
FIX: Reverting broken main.go and restoring core proxy routes
Browse files
main.go
CHANGED
|
@@ -7,21 +7,24 @@ import (
|
|
| 7 |
)
|
| 8 |
|
| 9 |
func main() {
|
| 10 |
-
// 1.
|
| 11 |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 12 |
http.ServeFile(w, r, "index.html")
|
| 13 |
})
|
| 14 |
|
| 15 |
-
// 2.
|
| 16 |
-
//
|
| 17 |
-
// En tu
|
| 18 |
-
|
| 19 |
|
|
|
|
| 20 |
port := os.Getenv("PORT")
|
| 21 |
if port == "" { port = "7860" }
|
| 22 |
|
| 23 |
-
log.Printf("Servidor
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
log.Fatal(err)
|
| 26 |
}
|
| 27 |
-
}//
|
|
|
|
| 7 |
)
|
| 8 |
|
| 9 |
func main() {
|
| 10 |
+
// 1. Prioridad: Servir tu Interfaz de HOI4 (Frente Oriental)
|
| 11 |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 12 |
http.ServeFile(w, r, "index.html")
|
| 13 |
})
|
| 14 |
|
| 15 |
+
// 2. RECUPERACI脫N DE LA L脫GICA ORIGINAL:
|
| 16 |
+
// Invocamos el router principal del proxy que ya maneja /stats, /v1, etc.
|
| 17 |
+
// En tu c贸digo, esto se hace llamando a la funci贸n que configura el ServeMux por defecto.
|
| 18 |
+
SetupRoutes()
|
| 19 |
|
| 20 |
+
// 3. Configuraci贸n del puerto para Hugging Face
|
| 21 |
port := os.Getenv("PORT")
|
| 22 |
if port == "" { port = "7860" }
|
| 23 |
|
| 24 |
+
log.Printf("Servidor RESTAURADO en puerto %s", port)
|
| 25 |
+
|
| 26 |
+
// Usamos nil para que use el DefaultServeMux donde SetupRoutes registr贸 todo
|
| 27 |
+
if err := http.ListenAndServe(":"+port, nil); err != nil {
|
| 28 |
log.Fatal(err)
|
| 29 |
}
|
| 30 |
+
}// Restore Point: dom 19 abr 2026 22:37:17 -04
|