mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
functions: remove viper config file (#221)
This commit is contained in:
3
main.go
3
main.go
@@ -38,10 +38,7 @@ func init() {
|
|||||||
viper.SetDefault(envPort, 8080)
|
viper.SetDefault(envPort, 8080)
|
||||||
viper.SetDefault(envAPIURL, fmt.Sprintf("http://127.0.0.1:%d", viper.GetInt(envPort)))
|
viper.SetDefault(envAPIURL, fmt.Sprintf("http://127.0.0.1:%d", viper.GetInt(envPort)))
|
||||||
viper.SetDefault(envNumAsync, 1)
|
viper.SetDefault(envNumAsync, 1)
|
||||||
viper.SetConfigName("config")
|
|
||||||
viper.AddConfigPath(".")
|
|
||||||
viper.AutomaticEnv() // picks up env vars automatically
|
viper.AutomaticEnv() // picks up env vars automatically
|
||||||
viper.ReadInConfig()
|
|
||||||
logLevel, err := log.ParseLevel(viper.GetString("log_level"))
|
logLevel, err := log.ParseLevel(viper.GetString("log_level"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Fatalln("Invalid log level.")
|
log.WithError(err).Fatalln("Invalid log level.")
|
||||||
|
|||||||
Reference in New Issue
Block a user