1
0
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:
Ferdinand Mütsch
2020-05-24 14:50:04 +02:00
parent 041a49ede4
commit a317dc6942
5 changed files with 53 additions and 44 deletions

17
middlewares/logging.go Normal file
View 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)
}