gorilla

    gorilla/mux

    Package gorilla/mux is a powerful HTTP router and URL matcher for building Go web servers with 🦍

    21.8K stars
    1.9K forks
    21.8K GitHub watchers
    Updated Nov 1, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    Loading star history...

    Where it stands

    Rank, growth pace and release cadence relative to everything GStars tracks.

    The project lists 101 contributors on GitHub.

    Use Cases & Benefits

    • Implements a flexible HTTP request router and URL matcher for building Go web servers.
    • Enables complex route matching with variables, regex, subrouters, and middleware for optimized and maintainable request handling.
    • Use for building RESTful APIs with dynamic URL parameters and method-based routing in Go applications.
    • Use for serving static files and single-page applications alongside API endpoints within a single Go server.
    • Use for creating modular web services with middleware support for authentication, logging, and CORS handling.

    Should you depend on it?

    License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.

    License

    BSD 3-Clause

    Permissive: commercial use, modification and redistribution are allowed with attribution.

    Community files

    • README: present
    • Contributing guide: present
    • Code of conduct: present

    Watch-outs

    • Warning: No commits in over a year (last push Aug 2024).

    General guidance from repository metadata, not legal advice. How we score

    From the README

    Package gorilla/mux implements a request router and dispatcher for matching incoming requests to their respective handler.

    Let's start registering a couple of URL paths and handlers:

    Here we register three routes mapping URL paths to handlers. This is equivalent to how http.HandleFunc() works: if an incoming request URL matches one of the paths, the corresponding handler is called passing (http.ResponseWriter, *http.Request) as parameters.

    Paths can have variables. They are defined using the format {name} or {name:pattern}. If a regular expression pattern is not defined, the matched variable will be anything until the next slash. For example:

    The names are used to create a map of route variables which can be retrieved calling mux.Vars():

    And this is all you need to know about the basic usage. More advanced options are explained below.

    Excerpt from the gorilla/mux README on GitHub (BSD-3-Clause license). Β© its authors.Read the full README on GitHub

    Daily snapshots

    Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots

    Forks

    1.9K-3

    Open issues

    48+10

    Compared with peers in Networking

    Fastest-growing repositories GStars tracks in this cohort for the week of Nov 8, by 7-day star growth

    gorilla/mux compared with Networking repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    MHSanaei/3x-ui49.6K+44852137 days ago
    GyulyVGC/sniffnet42.3K+42275111 days ago
    tailscale/tailscale38.9K+31175today
    netbirdio/netbird30.9K+26775today
    fosrl/pangolin23.6K+218756 days ago
    gorilla/mux21.8Kβ€”45β€”
    Category median38.9K+31175β€”

    Also by gorilla

    Other repositories from this maintainer that GStars tracks

    Discover Repositories

    Search across tracked repositories by name or description