Spaces:
Paused
Paused
fix: force port 7860 for huggingface stability
Browse files
main.go
CHANGED
|
@@ -1,32 +1,23 @@
|
|
| 1 |
package main
|
| 2 |
-
|
| 3 |
import (
|
| 4 |
"log"
|
| 5 |
"net/http"
|
| 6 |
"os"
|
| 7 |
)
|
| 8 |
-
|
| 9 |
func main() {
|
| 10 |
-
//
|
| 11 |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 12 |
http.ServeFile(w, r, "index.html")
|
| 13 |
})
|
| 14 |
|
| 15 |
-
//
|
| 16 |
-
//
|
| 17 |
-
http.HandleFunc("/stats", StatsHandler)
|
| 18 |
-
|
| 19 |
-
// 3. Ruta de Depuraci贸n Privada
|
| 20 |
-
http.HandleFunc("/internal-debug-v1", DebugHandler)
|
| 21 |
-
|
| 22 |
-
// 4. Proxy V1 (SillyTavern, etc)
|
| 23 |
-
// http.HandleFunc("/v1/", ProxyHandler)
|
| 24 |
-
|
| 25 |
-
port := os.Getenv("PORT")
|
| 26 |
-
if port == "" { port = "7860" }
|
| 27 |
|
| 28 |
-
|
|
|
|
| 29 |
if err := http.ListenAndServe(":"+port, nil); err != nil {
|
| 30 |
log.Fatal(err)
|
| 31 |
}
|
| 32 |
-
}
|
|
|
|
| 1 |
package main
|
|
|
|
| 2 |
import (
|
| 3 |
"log"
|
| 4 |
"net/http"
|
| 5 |
"os"
|
| 6 |
)
|
|
|
|
| 7 |
func main() {
|
| 8 |
+
// Servir la interfaz HOI4
|
| 9 |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 10 |
http.ServeFile(w, r, "index.html")
|
| 11 |
})
|
| 12 |
|
| 13 |
+
// Endpoints de datos (deben estar definidos en tus otros archivos .go)
|
| 14 |
+
// Si dan error de compilaci贸n, comenta estas l铆neas
|
| 15 |
+
// http.HandleFunc("/stats", StatsHandler)
|
| 16 |
+
// http.HandleFunc("/internal-debug-v1", DebugHandler)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
port := "7860" // Puerto obligatorio para HF
|
| 19 |
+
log.Printf("Servidor iniciado en puerto %s", port)
|
| 20 |
if err := http.ListenAndServe(":"+port, nil); err != nil {
|
| 21 |
log.Fatal(err)
|
| 22 |
}
|
| 23 |
+
}
|