initial page
This commit is contained in:
20
middlewares/notfound.go
Normal file
20
middlewares/notfound.go
Normal file
@@ -0,0 +1,20 @@
|
||||
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 {
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user