fix: use readConfig

This commit is contained in:
Bastien Riviere 2023-09-01 22:35:46 +02:00
parent b69e3d4ef3
commit 91479478b9
Signed by: babariviere
GPG key ID: 4E5F0839249F162E

View file

@ -33,7 +33,7 @@ func readConfig() (config.Config, error) {
} }
func main() { func main() {
cfg, err := config.ReadConfig("config.scfg") cfg, err := readConfig()
if err != nil { if err != nil {
slog.Error("failed to read config", "error", err) slog.Error("failed to read config", "error", err)
os.Exit(2) os.Exit(2)
@ -77,6 +77,7 @@ func main() {
} }
slog.Debug("Registering bridge", "route", route, "handler", handler.Type) slog.Debug("Registering bridge", "route", route, "handler", handler.Type)
// TODO: use default topic if topic == ""
bridge := bridge.NewBridge(cfg.Ntfy.Server, handler.Topic, h) bridge := bridge.NewBridge(cfg.Ntfy.Server, handler.Topic, h)
if !auth.IsEmpty() { if !auth.IsEmpty() {
bridge.WithAuth(auth) bridge.WithAuth(auth)