fix(contorller): env corrections on where to look for the file when running

This commit is contained in:
2025-09-30 19:54:10 -05:00
parent 18e57127e2
commit b84ecbf30c
26 changed files with 2637 additions and 27 deletions

View File

@@ -5,26 +5,18 @@ import (
"log"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/gin-gonic/gin"
socketio "github.com/googollee/go-socket.io"
"github.com/joho/godotenv"
"lst.net/internal/bot"
"lst.net/pkg"
)
func main() {
exePath, _ := os.Executable()
exeDir := filepath.Dir(exePath)
if err := godotenv.Load(filepath.Join(exeDir, ".env")); err != nil {
// fallback dev path
_ = godotenv.Load("../.env")
}
loadEnv()
// gin stuff
basePath := "/api/controller"