This commit is contained in:
jdl committed 2024-12-12 21:11:17 +01:00
1 parent 03ff1aac80
commit fdf0066fc2
35 files changed
+1138 -331

No files matched your search

+15
View File
@@ -64,3 +64,18 @@ func (app *App) handleSignedIn(pattern string, fn handlerFunc) {
return fn(s, w, r)
})
}
type peerHandlerFunc func(w http.ResponseWriter, r *http.Request) error
func (app *App) handlePeer(pattern string, fn peerHandlerFunc) {
wrapped := func(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
if err := fn(w, r); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
app.mux.HandleFunc(pattern,
webutil.WithLogging(
wrapped))
}