Files
portfolio/middlewares/notfound.go
2025-02-13 08:35:26 +01:00

21 lines
412 B
Go

package middlewares
import (
"log"
"net/http"
"github.com/a-h/templ"
)
func NotFound(next http.Handler, component templ.Component) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
res := newStatusResponseWriter(w)
log.Println("before NotFound: ", res.status)
next.ServeHTTP(res, r)
log.Println("after NotFound: ", res.status)
if res.status == 0 {
}
})
}