Config location can now be set on start

This commit is contained in:
Timo Ley 2020-09-06 11:52:25 +02:00
parent df4b25de98
commit fc1c76125f

View file

@ -8,7 +8,13 @@ import (
func main() { func main() {
var auth maven.AuthManager var auth maven.AuthManager
config := readconf("config.yaml") var conf string
if len(os.Args) > 1 {
conf = os.Args[1]
} else {
conf = "config.yaml"
}
config := readconf(conf)
auth = maven.Create(config.Database) auth = maven.Create(config.Database)
maven.StartServer(config.Server, &auth) maven.StartServer(config.Server, &auth)
} }