diff --git a/internal/http/http.go b/internal/http/http.go index c0322c2f..0a9b15bd 100644 --- a/internal/http/http.go +++ b/internal/http/http.go @@ -12,7 +12,6 @@ import ( "github.com/rs/zerolog/log" "demodesk/neko/internal/http/endpoint" - customMiddleware "demodesk/neko/internal/http/middleware" "demodesk/neko/internal/types" "demodesk/neko/internal/types/config" ) @@ -30,7 +29,7 @@ func New(conf *config.Server, webSocketHandler types.WebSocketHandler) *Server { router := chi.NewRouter() router.Use(middleware.Recoverer) // Recover from panics without crashing server router.Use(middleware.RequestID) // Create a request ID for each request - router.Use(customMiddleware.Logger) // Log API request calls using custom logger function + router.Use(Logger) // Log API request calls using custom logger function router.Get("/ws", func(w http.ResponseWriter, r *http.Request) { if webSocketHandler.Upgrade(w, r) != nil { @@ -51,7 +50,7 @@ func New(conf *config.Server, webSocketHandler types.WebSocketHandler) *Server { router.NotFound(endpoint.Handle(func(w http.ResponseWriter, r *http.Request) error { return &endpoint.HandlerError{ Status: http.StatusNotFound, - Message: fmt.Sprintf("file '%s' is not found", r.RequestURI), + Message: fmt.Sprintf("Endpoint '%s' was not found.", r.RequestURI), } })) diff --git a/internal/http/middleware/logger.go b/internal/http/logger.go similarity index 98% rename from internal/http/middleware/logger.go rename to internal/http/logger.go index b20ea9ac..dabffea1 100644 --- a/internal/http/middleware/logger.go +++ b/internal/http/logger.go @@ -1,4 +1,4 @@ -package middleware +package http import ( "fmt"