From 49766901293631aeabfc96e8d80aba305f420630 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 2 Oct 2025 18:36:06 +0200 Subject: feat(backend): config to set domain --- main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index e1c13bb..abab2ea 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,13 @@ func init() { func main() { flag.Parse() - r := backend.NewRouter(dev) + cfg, ok := backend.LoadConfig(configFile) + if !ok { + slog.Info("exiting") + os.Exit(1) + } + + r := backend.NewRouter(dev, cfg) backend.HandleHome(r) @@ -72,7 +78,7 @@ func main() { sc := make(chan os.Signal, 1) signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) - ok := true + ok = true for ok { select { case err := <-errChan: -- cgit v1.2.3