feat(t229): load ERP credentials from dotenv
This commit is contained in:
@@ -34,7 +34,7 @@ func main() {
|
||||
}
|
||||
|
||||
func run() error {
|
||||
cfg, err := config.Load(os.LookupEnv)
|
||||
cfg, err := loadConfig(os.LookupEnv, config.DefaultERPEnvironmentFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -93,6 +93,20 @@ func run() error {
|
||||
}
|
||||
}
|
||||
|
||||
func loadConfig(
|
||||
lookup config.LookupEnvironment,
|
||||
environmentFile string,
|
||||
) (config.Config, error) {
|
||||
effectiveLookup, err := config.WithERPEnvironmentFile(
|
||||
environmentFile,
|
||||
lookup,
|
||||
)
|
||||
if err != nil {
|
||||
return config.Config{}, err
|
||||
}
|
||||
return config.Load(effectiveLookup)
|
||||
}
|
||||
|
||||
func shutdownServer(
|
||||
server *http.Server,
|
||||
serverErrors <-chan error,
|
||||
|
||||
Reference in New Issue
Block a user