summaryrefslogtreecommitdiff
path: root/srv/src/api/render.go
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-17 14:13:56 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-17 14:15:38 -0600
commit9a67ef921100d16294b30b7d111206789c8e1feb (patch)
treee6c79eb818086da2b73d6df525d9db86c3b1ed25 /srv/src/api/render.go
parente742a2d6d5b75bce14a9be688c47c88807cfe94b (diff)
Add follow.html to v2
Diffstat (limited to 'srv/src/api/render.go')
-rw-r--r--srv/src/api/render.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/srv/src/api/render.go b/srv/src/api/render.go
index 2b6b5a0..0f45211 100644
--- a/srv/src/api/render.go
+++ b/srv/src/api/render.go
@@ -178,3 +178,17 @@ func (a *api) renderPostHandler() http.Handler {
}
})
}
+
+func (a *api) renderDumbHandler(tplName string) http.Handler {
+
+ tpl := a.mustParseTpl(tplName)
+
+ return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
+ if err := tpl.Execute(rw, nil); err != nil {
+ apiutil.InternalServerError(
+ rw, r, fmt.Errorf("rendering %q: %w", tplName, err),
+ )
+ return
+ }
+ })
+}