2024-03-22 15:08:24 +01:00

25 lines
287 B
Go

package main
import (
"fmt"
"time"
"git.akyoto.dev/go/web"
)
func main() {
s := web.NewServer()
s.Use(func(ctx web.Context) error {
start := time.Now()
defer func() {
fmt.Println(ctx.Request().Path(), time.Since(start))
}()
return ctx.Next()
})
s.Run(":8080")
}