Moge-Row commited on
Commit
ed2771c
·
1 Parent(s): beb42fb

fix: restore SetupRoutes and core proxy logic

Browse files
Files changed (1) hide show
  1. main.go +5 -5
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
- // Servir el index.html que creamos (la interfaz de HOI4)
12
  http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
13
  http.ServeFile(w, r, "index.html")
14
  })
15
 
16
- // Registrar rutas de keys.go (usando las funciones originales)
 
17
  SetupRoutes()
18
 
19
  port := os.Getenv("PORT")
20
  if port == "" { port = "7860" }
21
 
22
- log.Printf("Servidor operativo en puerto %s", port)
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
  }