Moge-Row commited on
Commit
e3b9f9f
·
1 Parent(s): 28d5a50

restore full html soviet theme IS-2

Browse files
Files changed (1) hide show
  1. main.go +22 -24
main.go CHANGED
@@ -1,31 +1,29 @@
1
  package main
2
 
3
  import (
4
- "zai-proxy/internal/config"
5
- "zai-proxy/internal/handler"
6
- "zai-proxy/internal/logger"
7
- "zai-proxy/internal/proxy"
8
- "zai-proxy/internal/version"
9
- "net/http"
10
  )
11
 
12
  func main() {
13
- config.LoadConfig()
14
- logger.InitLogger()
15
- proxy.LoadProxies("proxies.txt")
16
- version.StartVersionUpdater()
17
- http.HandleFunc("/", handler.HandleIndex)
18
- http.HandleFunc("/models", // handler.HandleModelsPage)
19
- http.HandleFunc("/genkey", handler.HandleGenKey)
20
- http.HandleFunc("/stats", handler.HandleStats)
21
- http.HandleFunc("/internal-debug-v1", handler.HandleSecretReveal)
22
- http.HandleFunc("/internal-debug-v1", handler.HandleSecretReveal)
23
- // http.HandleFunc("/v1/models", // handler.HandleModels)
24
- http.HandleFunc("/v1/chat/completions", handler.HandleChatCompletions)
25
- http.HandleFunc("/v1/messages", handler.HandleMessages)
26
- addr := ":" + config.Cfg.Port
27
- logger.LogInfo("Server starting on %s", addr)
28
- if err := http.ListenAndServe(addr, nil); err != nil {
29
- logger.LogError("Server failed: %v", err)
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
  }