fix(controller): fixes for a remote update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user