From f5b5f72f7eaf14692b8036c3698037c647b2423a Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 5 May 2024 19:02:43 +0200 Subject: feat: Add qtc templating --- main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index ba441fe..55f866e 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( "git.gabrielgio.me/cerrado/pkg/config" "git.gabrielgio.me/cerrado/pkg/worker" + "git.gabrielgio.me/cerrado/templates" ) func main() { @@ -51,10 +52,11 @@ func run(ctx context.Context) error { return } - if _, err := w.Write(b); err != nil { - slog.Error("Error handling index", "error", err) - return + hello := &templates.HelloPage{ + Body: string(b), } + + templates.WritePageTemplate(w, hello) }) serverTask := worker.NewServerTask(&http.Server{Handler: mux, Addr: "0.0.0.0:8080"}) -- cgit v1.2.3