Skip to content

Instantly share code, notes, and snippets.

@alexedwards
Created April 19, 2025 15:01
Show Gist options
  • Save alexedwards/fa29a1f834e1ad9e60cba27e9e6ef76d to your computer and use it in GitHub Desktop.
Save alexedwards/fa29a1f834e1ad9e60cba27e9e6ef76d to your computer and use it in GitHub Desktop.
mux := http.NewServeMux()
mux.Handle("/", recoverMiddleware(requestIDMiddleware(loggingMiddleware(http.HandlerFunc(homeHandler)))))
mux.Handle("/about", recoverMiddleware(requestIDMiddleware(loggingMiddleware(http.HandlerFunc(aboutHandler)))))
mux.Handle("/admin", recoverMiddleware(requestIDMiddleware(loggingMiddleware(authenticationMiddleware(adminRoleCheckMiddleware(http.HandlerFunc(adminDashboardHandler)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment