aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-05-05 19:02:43 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-05-05 19:02:43 +0200
commitf5b5f72f7eaf14692b8036c3698037c647b2423a (patch)
treef74eb37277771fd1dceec702d1f3820fb553dc2a /main.go
parent129c73757036a8073467a2046bc73e95918f1ca1 (diff)
downloadcerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.tar.gz
cerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.tar.bz2
cerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.zip
feat: Add qtc templating
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 5 insertions, 3 deletions
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"})