Package gorilla/mux implements a request router and dispatcher for matching incoming requests to their respective handler. The name mux stands for "HTTP request multiplexer". Like the standard http.ServeMux, mux.Router matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions. The main features are that it implements the http.Handler interface so it is compatible with the standard http.ServeMux, requests can be matched based on URL host, path, path prefix, schemes, header and query values, HTTP methods or using custom matchers, URL hosts, paths and query values can have variables with an optional regular expression. Also, registered URLs can be built, or "reversed", which helps maintaining references to resources, Routes can be used as subrouters: nested routes are only tested if the parent route matches. And many more features.

Features

  • Mux supports the addition of middlewares to a Router
  • Mux middlewares are defined using the de facto standard type
  • Testing handlers in a Go web application is straightforward, and mux doesn't complicate this any further
  • It implements the http.Handler interface so it is compatible with the standard http.ServeMux
  • URL hosts, paths and query values can have variables with an optional regular expression
  • mux.Router matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL

Project Samples

Project Activity

See All Activity >

License

BSD License

Follow gorilla/mux

gorilla/mux Web Site

Other Useful Business Software
AI-generated apps that pass security review Icon
AI-generated apps that pass security review

Stop waiting on engineering. Build production-ready internal tools with AI—on your company data, in your cloud.

Retool lets you generate dashboards, admin panels, and workflows directly on your data. Type something like “Build me a revenue dashboard on my Stripe data” and get a working app with security, permissions, and compliance built in from day one. Whether on our cloud or self-hosted, create the internal software your team needs without compromising enterprise standards or control.
Try Retool free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of gorilla/mux!

Additional Project Details

Programming Language

Go

Related Categories

Go HTTP Servers, Go Build Tools

Registered

2021-04-14