You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
841 B
Go

/*
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
*/
package main
import (
"gitea.ravianand.me/Dan6erbond/listy/cmd"
"github.com/spf13/viper"
)
func main() {
viper.SetConfigName("config") // name of config file (without extension)
viper.SetConfigType("yaml") // REQUIRED if the config file does not have the extension in the name
viper.AddConfigPath("/etc/appname/") // path to look for the config file in
viper.AddConfigPath("$HOME/.appname") // call multiple times to add many search paths
viper.AddConfigPath(".") // optionally look for config in the working directory
viper.ReadInConfig() // Find and read the config file
viper.SetDefault("server.scheme", "http")
viper.SetDefault("server.host", "localhost:5001")
viper.BindEnv("mongodb.uri", "MONGODB_URI")
cmd.Execute()
}