2024-03-13 19:18:01 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.akyoto.dev/go/server"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
s := server.New()
|
|
|
|
|
|
|
|
s.Use(func(ctx server.Context) error {
|
|
|
|
start := time.Now()
|
|
|
|
|
|
|
|
defer func() {
|
2024-03-16 14:22:47 +00:00
|
|
|
fmt.Println(ctx.Request().Path(), time.Since(start))
|
2024-03-13 19:18:01 +00:00
|
|
|
}()
|
|
|
|
|
|
|
|
return ctx.Next()
|
|
|
|
})
|
|
|
|
|
|
|
|
s.Run(":8080")
|
|
|
|
}
|