diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-05 19:02:43 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-05 19:02:43 +0200 |
commit | f5b5f72f7eaf14692b8036c3698037c647b2423a (patch) | |
tree | f74eb37277771fd1dceec702d1f3820fb553dc2a /main.go | |
parent | 129c73757036a8073467a2046bc73e95918f1ca1 (diff) | |
download | cerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.tar.gz cerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.tar.bz2 cerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.zip |
feat: Add qtc templating
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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"}) |