package services import ( "log" "os" "strconv" "git.jamestombleson.com/jtom38/go-cook/api/domain" "github.com/joho/godotenv" ) func NewEnvConfig() domain.EnvConfig { err := godotenv.Load() if err != nil { log.Println(err) } disableMigrations, err := strconv.ParseBool(os.Getenv("DisableMigrationsOnStartup")) if err != nil { disableMigrations = false } return domain.EnvConfig{ AdminToken: os.Getenv("AdminToken"), JwtSecret: os.Getenv("JwtSecret"), ApiUri: os.Getenv("ApiUri"), DisableMigrationsOnStartUp: disableMigrations, } }