added store

This commit is contained in:
bronku 2025-02-07 08:40:04 +01:00
parent ea6546ec17
commit 0570e47be9
6 changed files with 208 additions and 151 deletions

17
middleware.go Normal file
View file

@ -0,0 +1,17 @@
package main
import (
"fmt"
"net/http"
"time"
)
func logger(in http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
log := fmt.Sprint(r.Method, " ", r.URL.String())
in(w, r)
log += fmt.Sprint(" ", time.Since(start))
fmt.Println(log)
}
}