Spaces:
Paused
Paused
fix: total sync and route registration
Browse files
main.go
CHANGED
|
@@ -1,26 +1,16 @@
|
|
| 1 |
package main
|
| 2 |
-
|
| 3 |
import (
|
| 4 |
-
"log"
|
| 5 |
-
"net/http"
|
| 6 |
-
"os"
|
| 7 |
)
|
| 8 |
-
|
| 9 |
func main() {
|
| 10 |
-
/
|
| 11 |
-
http.
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 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 |
}
|
|
|
|
| 1 |
package main
|
|
|
|
| 2 |
import (
|
| 3 |
+
"log"
|
| 4 |
+
"net/http"
|
| 5 |
+
"os"
|
| 6 |
)
|
|
|
|
| 7 |
func main() {
|
| 8 |
+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
| 9 |
+
http.ServeFile(w, r, "index.html")
|
| 10 |
+
})
|
| 11 |
+
// Inicia las rutas definidas en keys.go, index.go, etc.
|
| 12 |
+
SetupRoutes()
|
| 13 |
+
port := os.Getenv("PORT")
|
| 14 |
+
if port == "" { port = "7860" }
|
| 15 |
+
log.Fatal(http.ListenAndServe(":" + port, nil))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|