mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-24 21:24:43 +01:00
fixed some bugs related to middleware
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package middleware
|
||||
|
||||
import "github.com/lukerodham/tuu"
|
||||
import (
|
||||
"github.com/lukerodham/tuu"
|
||||
)
|
||||
|
||||
// RequestLogger is a default/example implementation of how a logging middleware would be implemented.
|
||||
func RequestLogger(next tuu.Handler) tuu.Handler {
|
||||
return func(c tuu.Context) error {
|
||||
c.Logger().WithField("url", c.Value("path")).Debug("New request")
|
||||
c.Logger().WithField("url", c.Value("path")).Info("New request")
|
||||
|
||||
return next(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user