removed 'internal' directory

This commit is contained in:
Bronku 2025-06-19 21:48:06 +02:00
parent 8c200a5a6c
commit 65709049d7
42 changed files with 35 additions and 44 deletions

13
logging/error.go Normal file
View file

@ -0,0 +1,13 @@
package logging
import (
"fmt"
"net/http"
)
func ErrorPage(err error, status int) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(status)
fmt.Fprint(w, err.Error())
}
}

16
logging/logger.go Normal file
View file

@ -0,0 +1,16 @@
package logging
import (
"fmt"
"net/http"
"time"
)
func Middleware(in http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
fmt.Println(r.Method, r.URL.String())
in.ServeHTTP(w, r)
fmt.Println(r.Method, "finished in", time.Since(start))
})
}