fix(controller): fixes for a remote update

This commit is contained in:
2025-09-07 11:01:38 -05:00
parent e318615ea7
commit 766bdd1830
6 changed files with 353 additions and 24 deletions

View File

@@ -10,10 +10,10 @@ import (
"github.com/gin-gonic/gin"
socketio "github.com/googollee/go-socket.io"
"github.com/joho/godotenv"
router "lst.net/internal/route_handler"
)
func main() {
err := godotenv.Load("../.env")
if err != nil {
fmt.Println("Warning: .env file not found")
@@ -29,10 +29,11 @@ func main() {
if os.Getenv("NODE_ENV") != "production" {
basePath = "/lst/api/controller"
}
r := router.Setup(basePath) // returns *gin.Engine
server := socketio.NewServer(nil)
r := Setup(basePath, server) // returns *gin.Engine
server.OnConnect("/", func(s socketio.Conn) error {
fmt.Println("✅ Client connected:", s.ID())
return nil