A simple and fast HTTP router for Go that supports regexp parameters and is optimized for building RESTful APIs.
gorouter is a simple and fast HTTP router for the Go programming language. It provides a lightweight way to handle HTTP requests with support for URL parameters, regex patterns, and route grouping, making it ideal for building RESTful APIs and web frameworks. The project was created to offer a performant router that includes regex support, addressing gaps in other popular Go routers.
Go developers building web applications, REST APIs, or custom web frameworks who need a fast, regex-capable router with middleware support.
Developers choose gorouter for its balance of speed and regex functionality, offering performance comparable to httprouter while providing the flexibility of regex parameters that routers like gorilla/mux support.
xujiajun/gorouter is a simple and fast HTTP router for Go. It is easy to build RESTful APIs and your web framework.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show gorouter is nearly as fast as httprouter while supporting regex, making it ideal for speed-critical applications like REST APIs.
Enables flexible URL matching with named regex parameters, allowing type validation directly in routes without additional logic, as shown in the examples.
Built solely on Go's standard library, reducing bloat and ensuring compatibility with minimal setup, which the README highlights as a key feature.
Supports seamless chaining of multiple middleware functions for request processing, demonstrated with logging and tracing in the examples.
Static file handling requires manual regex-based path matching and custom handlers, unlike routers with built-in static serving methods, as seen in the convoluted example.
Lacks built-in support for subdomains, WebSockets, or integrated security middleware, necessitating custom implementations for common web needs.
As a niche project, it has fewer third-party extensions and less frequent updates compared to established routers like chi or gorilla/mux, which may affect long-term support.