From 7bea159f2be142813d976d0e7a12d30ec5624a42 Mon Sep 17 00:00:00 2001 From: 1e99 <1e99@1e99.eu> Date: Wed, 30 Oct 2024 10:24:41 +0100 Subject: [PATCH] add middlewares package --- main.go | 3 ++- {routes => middlewares}/logger.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename {routes => middlewares}/logger.go (91%) diff --git a/main.go b/main.go index 09c6b0c..9d1b4f2 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "net/http" "os" + "git.1e99.eu/1e99/passed/middlewares" "git.1e99.eu/1e99/passed/routes" "git.1e99.eu/1e99/passed/storage" ) @@ -34,7 +35,7 @@ func run() error { address = ":3000" } - err = http.ListenAndServe(address, routes.Logger(mux)) + err = http.ListenAndServe(address, middlewares.Logger(mux)) if err != nil { return err } diff --git a/routes/logger.go b/middlewares/logger.go similarity index 91% rename from routes/logger.go rename to middlewares/logger.go index dbb1785..869b00d 100644 --- a/routes/logger.go +++ b/middlewares/logger.go @@ -1,4 +1,4 @@ -package routes +package middlewares import ( "log"