first commit

This commit is contained in:
2025-09-30 20:21:33 +02:00
commit 68902f86af
10 changed files with 418 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package api
import "net/http"
func recoverMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer func() {
err := recover()
if err != nil {
internalServerError(w, r)
}
}()
next.ServeHTTP(w, r)
})
}