features/module-name #14

Merged
jtom38 merged 9 commits from features/module-name into main 2024-04-05 17:55:07 -07:00
2 changed files with 15 additions and 6 deletions
Showing only changes of commit d2aa1b99ce - Show all commits

View File

@ -3,4 +3,5 @@ package domain
type EnvConfig struct {
AdminToken string
JwtSecret string
DisableMigrationsOnStartUp bool
}

View File

@ -1,9 +1,11 @@
package services
import (
"go-cook/api/domain"
"log"
"os"
"strconv"
"git.jamestombleson.com/jtom38/go-cook/api/domain"
"github.com/joho/godotenv"
)
@ -14,8 +16,14 @@ func NewEnvConfig() domain.EnvConfig {
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"),
DisableMigrationsOnStartUp: disableMigrations,
}
}