add: Environment Var support
This commit is contained in:
@@ -17,14 +17,15 @@ import (
|
||||
)
|
||||
|
||||
func Run() {
|
||||
cfg := config.LoadConfig()
|
||||
logger.Info.Printf("Config: %+v", cfg)
|
||||
err := database.InitDB(cfg.DB.Path)
|
||||
config.LoadConfig()
|
||||
logger.Info.Printf("Config loaded: %#v", config.CFG)
|
||||
|
||||
err := database.InitDB(config.DB.Path)
|
||||
if err != nil {
|
||||
logger.Error.Fatalf("Couldn't init database: %v", err)
|
||||
}
|
||||
|
||||
emailService := services.NewEmailService(cfg.SMTP.Host, cfg.SMTP.Port, cfg.SMTP.User, cfg.SMTP.Password, cfg.SMTP.AdminEmail)
|
||||
emailService := services.NewEmailService(config.SMTP.Host, config.SMTP.Port, config.SMTP.User, config.SMTP.Password, config.SMTP.AdminEmail)
|
||||
var consentRepo repositories.ConsentRepositoryInterface = &repositories.ConsentRepository{}
|
||||
consentService := &services.ConsentService{Repo: consentRepo}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user