From 9a67ef921100d16294b30b7d111206789c8e1feb Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 17 May 2022 14:13:56 -0600 Subject: Add follow.html to v2 --- srv/src/api/render.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'srv/src/api/render.go') 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 + } + }) +} -- cgit v1.2.3