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()