25 lines
280 B
Go
25 lines
280 B
Go
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() {
|
|
fmt.Println(ctx.Path(), time.Since(start))
|
|
}()
|
|
|
|
return ctx.Next()
|
|
})
|
|
|
|
s.Run(":8080")
|
|
}
|