mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
refactor: middlewares and get rid of negroni
This commit is contained in:
17
middlewares/logging.go
Normal file
17
middlewares/logging.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package middlewares
|
||||
|
||||
import (
|
||||
"github.com/gorilla/handlers"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
type LoggingMiddleware struct{}
|
||||
|
||||
func NewLoggingMiddleware() *LoggingMiddleware {
|
||||
return &LoggingMiddleware{}
|
||||
}
|
||||
|
||||
func (m *LoggingMiddleware) Handler(h http.Handler) http.Handler {
|
||||
return handlers.LoggingHandler(os.Stdout, h)
|
||||
}
|
Reference in New Issue
Block a user