features/module-name #14
@ -1,6 +1,7 @@
|
||||
package domain
|
||||
|
||||
type EnvConfig struct {
|
||||
AdminToken string
|
||||
JwtSecret string
|
||||
AdminToken string
|
||||
JwtSecret string
|
||||
DisableMigrationsOnStartUp bool
|
||||
}
|
@ -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"),
|
||||
AdminToken: os.Getenv("AdminToken"),
|
||||
JwtSecret: os.Getenv("JwtSecret"),
|
||||
DisableMigrationsOnStartUp: disableMigrations,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user