Chi
github.com
2
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Chi is a lightweight, idiomatic, and composable router for building HTTP services in Go, created by Peter Kieltyka. Built on top of the standard library net/http package introduced in Go 1.7, Chi requires no external dependencies and maintains a core router implementation of approximately 1,000 lines of code. The router uses a Patricia radix trie data structure for efficient URL pattern matching, enabling fast route resolution even with hundreds of registered endpoints. Chi is fully compatible with the standard Go context package, allowing handlers to pass request-scoped values, deadlines, and cancellation signals through the middleware chain. The middleware ecosystem includes a rich standard library covering request IDs, structured logging, panic recovery, gzip compression, rate limiting, request timeouts, HTTP basic authentication, and cache-control headers. Chi's design philosophy centers on composability: developers can mount sub-routers within parent routers, create route groups with shared middleware, and define inline middleware for individual routes, all while maintaining a clean and readable routing configuration. The library also includes a docgen tool that automatically generates routing documentation from registered routes, and supports URL parameters, wildcards, and custom route patterns. Chi is deployed in production environments at companies including Cloudflare, Heroku, 99Designs, and Pressly, and has accumulated over 22,000 GitHub stars. The project is released under the MIT license and provides extensive examples, benchmarks, and migration guides for developers transitioning from other Go HTTP routers.
Statistics
2
Views
0
Clicks
0
Like
0
Dislike