fix(contorller): env corrections on where to look for the file when running
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user