1
0

Tests can now use config files (#36)

This commit is contained in:
konrad
2018-12-18 16:01:46 +00:00
committed by Gitea
parent 67e94f95b0
commit 97febdb397
58 changed files with 16740 additions and 7785 deletions

View File

@ -40,6 +40,7 @@ func init() {
viper.SetDefault("service.JWTSecret", random)
viper.SetDefault("service.interface", ":3456")
viper.SetDefault("service.frontendurl", "")
ex, err := os.Executable()
if err != nil {
panic(err)
@ -82,6 +83,8 @@ func init() {
viper.AutomaticEnv()
// Load the config file
viper.AddConfigPath(exPath)
viper.AddConfigPath(viper.GetString("service.rootpath"))
viper.AddConfigPath(".")
viper.SetConfigName("config")
err = viper.ReadInConfig()