Moge-Row commited on
Commit
3387975
1 Parent(s): 5107e71

chore: minimal survival build

Browse files
Files changed (1) hide show
  1. main.go +8 -16
main.go CHANGED
@@ -7,29 +7,21 @@ import (
7
  )
8
 
9
  func main() {
10
- // 1. Servir la interfaz visual (HOI4)
11
  http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
12
  http.ServeFile(w, r, "index.html")
13
  })
14
 
15
- // 2. Intentar registrar las rutas del proxy (v1, stats, etc)
16
- // Usamos un recovery para que si falla, el servidor no muera
17
- defer func() {
18
- if r := recover(); r != nil {
19
- log.Printf("Error recuperado: %v", r)
20
- }
21
- }()
22
-
23
- // Llama a la l贸gica de tus otros archivos
24
- InitRoutes()
25
 
26
- // 3. Configuraci贸n del puerto
27
  port := os.Getenv("PORT")
28
  if port == "" { port = "7860" }
29
 
30
- log.Printf("Servidor operativo en puerto %s", port)
31
- err := http.ListenAndServe(":" + port, nil)
32
- if err != nil {
33
  log.Fatal(err)
34
  }
35
- }
 
7
  )
8
 
9
  func main() {
10
+ // Servir la interfaz visual (HOI4)
11
  http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
12
  http.ServeFile(w, r, "index.html")
13
  })
14
 
15
+ // Endpoint de emergencia para ver si el servidor vive
16
+ http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
17
+ w.Write([]byte("OK - FRENTE ORIENTAL OPERATIVO"))
18
+ })
 
 
 
 
 
 
19
 
 
20
  port := os.Getenv("PORT")
21
  if port == "" { port = "7860" }
22
 
23
+ log.Printf("Arrancando servidor en puerto %s", port)
24
+ if err := http.ListenAndServe(":" + port, nil); err != nil {
 
25
  log.Fatal(err)
26
  }
27
+ }