Spaces:
Paused
Paused
fix: restore SetupRoutes and core proxy logic
Browse files
main.go
CHANGED
|
@@ -4,23 +4,23 @@ import (
|
|
| 4 |
"log"
|
| 5 |
"net/http"
|
| 6 |
"os"
|
| 7 |
-
// Asegúrate de que los paquetes internos se carguen aquí
|
| 8 |
)
|
| 9 |
|
| 10 |
func main() {
|
| 11 |
-
//
|
| 12 |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 13 |
http.ServeFile(w, r, "index.html")
|
| 14 |
})
|
| 15 |
|
| 16 |
-
//
|
|
|
|
| 17 |
SetupRoutes()
|
| 18 |
|
| 19 |
port := os.Getenv("PORT")
|
| 20 |
if port == "" { port = "7860" }
|
| 21 |
|
| 22 |
-
log.Printf("Servidor
|
| 23 |
-
if err := http.ListenAndServe(":"+port, nil); err != nil {
|
| 24 |
log.Fatal(err)
|
| 25 |
}
|
| 26 |
}
|
|
|
|
| 4 |
"log"
|
| 5 |
"net/http"
|
| 6 |
"os"
|
|
|
|
| 7 |
)
|
| 8 |
|
| 9 |
func main() {
|
| 10 |
+
// 1. Servir la interfaz HOI4 desde la raíz
|
| 11 |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 12 |
http.ServeFile(w, r, "index.html")
|
| 13 |
})
|
| 14 |
|
| 15 |
+
// 2. Ejecutar la configuración de rutas original del proxy
|
| 16 |
+
// Esto activa /v1, /stats, y los endpoints de keys.go
|
| 17 |
SetupRoutes()
|
| 18 |
|
| 19 |
port := os.Getenv("PORT")
|
| 20 |
if port == "" { port = "7860" }
|
| 21 |
|
| 22 |
+
log.Printf("Servidor ROW-PROXY iniciado en puerto %s", port)
|
| 23 |
+
if err := http.ListenAndServe(":" + port, nil); err != nil {
|
| 24 |
log.Fatal(err)
|
| 25 |
}
|
| 26 |
}
|