From 60890b4478cc18dd072fbac0b38daaeded071317 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Thu, 18 Sep 2025 21:42:37 -0500 Subject: [PATCH] refactor(controller): changes the app env to app instead of node as it makes more sense --- controller/main.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/controller/main.go b/controller/main.go index 3ce532d..31615c9 100644 --- a/controller/main.go +++ b/controller/main.go @@ -28,7 +28,7 @@ func main() { // gin stuff basePath := "/api/controller" - if os.Getenv("NODE_ENV") != "production" { + if os.Getenv("APP_MODE") != "production" { basePath = "/lst/api/controller" } @@ -139,7 +139,16 @@ func main() { } }() - go bot.TheBot() + // only activate the bot if its on VMS036 or my dev server + host, err := os.Hostname() + if err != nil { + server.BroadcastToRoom("/", "update", "updateLogs", "Could not retrieve hostname") + return + } + if host == os.Getenv("PRIMARY_SERVER") { + go bot.TheBot() + } + go server.Serve() defer server.Close()