aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-10-27 13:32:39 +0100
committerWilliam Hergès <william@herges.fr>2025-10-27 13:32:39 +0100
commitf1e008670cd865520eb5f21fe6e7b56f02076a23 (patch)
tree33f099bced477c3e84fa60b20136354535d0c18c /main.go
parent7bd309f3ca44930c5207b94acc2d425b24d4b369 (diff)
feat(config): supports multiple sections
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/main.go b/main.go
index add522c..480762d 100644
--- a/main.go
+++ b/main.go
@@ -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)