package middlewares import ( "net/http" ) func AuthMiddleware(next http.Handler) http.Handler { return http.HandlerFunc( func(w http.ResponseWriter, r *http.Request) { token := r.Header.Get("Authorization") if token != "your-secret-token" { http.Error(w, "Forbidden", http.StatusForbidden) return } next.ServeHTTP(w, r) }) }