package main import ( "flag" "log/slog" "os" "git.lastassault.de/speatzle/morffix/config" "git.lastassault.de/speatzle/morffix/server" "git.lastassault.de/speatzle/morffix/worker" "github.com/BurntSushi/toml" ) var conf config.Config func main() { isserver := flag.Bool("server", false, "Run as Server") flag.Parse() confPath := "config.toml" _, err := os.Stat(confPath) if err != nil { confPath = "/etc/morffix/config.toml" } slog.Info("Loading Config", "path", confPath) _, err = toml.DecodeFile(confPath, &conf) if err != nil { slog.Error("Error Loading Config", "err", err) return } if *isserver { slog.Info("Starting Server...") server.Start(conf) } else { slog.Info("Starting Worker...") worker.Start(conf) } }