diff options
| author | William Hergès <william@herges.fr> | 2025-10-27 13:32:39 +0100 |
|---|---|---|
| committer | William Hergès <william@herges.fr> | 2025-10-27 13:32:39 +0100 |
| commit | f1e008670cd865520eb5f21fe6e7b56f02076a23 (patch) | |
| tree | 33f099bced477c3e84fa60b20136354535d0c18c /main.go | |
| parent | 7bd309f3ca44930c5207b94acc2d425b24d4b369 (diff) | |
feat(config): supports multiple sections
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -58,9 +58,11 @@ func main() { os.Exit(1) } - if ok = backend.LoadLogs(cfg); !ok { - slog.Info("exiting") - os.Exit(2) + for _, sec := range cfg.Sections { + if ok = sec.Load(cfg); !ok { + slog.Info("exiting") + os.Exit(2) + } } assetsFS := backend.UsableEmbedFS("dist", embeds) @@ -72,7 +74,9 @@ func main() { backend.HandleHome(r) backend.HandleRoot(r, cfg) - backend.HandleLogs(r) + for _, sec := range cfg.Sections { + sec.Handle(r) + } backend.Handle404(r) backend.HandleStaticFiles(r, "/assets", assetsFS) |
