Spaces:
Paused
Paused
restore full html soviet theme IS-2
Browse files
main.go
CHANGED
|
@@ -1,31 +1,29 @@
|
|
| 1 |
package main
|
| 2 |
|
| 3 |
import (
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
"zai-proxy/internal/proxy"
|
| 8 |
-
"zai-proxy/internal/version"
|
| 9 |
-
"net/http"
|
| 10 |
)
|
| 11 |
|
| 12 |
func main() {
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
//
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
| 31 |
}
|
|
|
|
| 1 |
package main
|
| 2 |
|
| 3 |
import (
|
| 4 |
+
"log"
|
| 5 |
+
"net/http"
|
| 6 |
+
"os"
|
|
|
|
|
|
|
|
|
|
| 7 |
)
|
| 8 |
|
| 9 |
func main() {
|
| 10 |
+
// 1. Servir tu interfaz visual (HOI4)
|
| 11 |
+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 12 |
+
http.ServeFile(w, r, "index.html")
|
| 13 |
+
})
|
| 14 |
+
|
| 15 |
+
// 2. Ruta de salud para verificar que vive
|
| 16 |
+
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
| 17 |
+
w.Write([]byte("Servidor Operativo"))
|
| 18 |
+
})
|
| 19 |
+
|
| 20 |
+
// Eliminamos la llamada a handler.HandleModels que está rompiendo el build
|
| 21 |
+
|
| 22 |
+
port := os.Getenv("PORT")
|
| 23 |
+
if port == "" { port = "7860" }
|
| 24 |
+
|
| 25 |
+
log.Printf("Levantando proxy en puerto %s", port)
|
| 26 |
+
if err := http.ListenAndServe(":" + port, nil); err != nil {
|
| 27 |
+
log.Fatal(err)
|
| 28 |
+
}
|
| 29 |
}
|