{"id":37202178,"url":"https://github.com/pengsrc/chi","last_synced_at":"2026-01-14T23:18:58.754Z","repository":{"id":57589086,"uuid":"79363984","full_name":"pengsrc/chi","owner":"pengsrc","description":"lightweight, idiomatic and composable router for building Go 1.7+ HTTP services","archived":false,"fork":true,"pushed_at":"2017-01-18T17:25:20.000Z","size":3243,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T12:43:34.455Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"go-chi/chi","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pengsrc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-18T17:15:55.000Z","updated_at":"2017-01-18T17:15:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pengsrc/chi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pengsrc/chi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengsrc%2Fchi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengsrc%2Fchi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengsrc%2Fchi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengsrc%2Fchi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pengsrc","download_url":"https://codeload.github.com/pengsrc/chi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengsrc%2Fchi/sbom","scorecard":{"id":727114,"data":{"date":"2025-08-11","repo":{"name":"github.com/pengsrc/chi","commit":"45e2c82f3a180a3c94dc36207f115621a1b48731"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}}]},"last_synced_at":"2025-08-22T13:09:06.940Z","repository_id":57589086,"created_at":"2025-08-22T13:09:06.940Z","updated_at":"2025-08-22T13:09:06.940Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T23:18:57.007Z","updated_at":"2026-01-14T23:18:58.620Z","avatar_url":"https://github.com/pengsrc.png","language":"Go","readme":"\u003cimg alt=\"chi\" src=\"https://cdn.rawgit.com/pressly/chi/master/_examples/chi.svg\" width=\"220\" /\u003e\n===\n\n[![GoDoc Widget]][GoDoc] [![Travis Widget]][Travis]\n\n`chi` is a lightweight, idiomatic and composable router for building Go 1.7+ HTTP services. It's\nespecially good at helping you write large REST API services that are kept maintainable as your\nproject grows and changes. `chi` is built on the new `context` package introduced in Go 1.7 to\nhandle signaling, cancelation and request-scoped values across a handler chain.\n\nThe focus of the project has been to seek out an elegant and comfortable design for writing\nREST API servers, written during the development of the Pressly API service that powers our\npublic API service, which in turn powers all of our client-side applications.\n\nThe key considerations of chi's design are: project structure, maintainability, standard http\nhandlers (stdlib-only), developer productivity, and deconstructing a large system into many small\nparts. The core router `github.com/pressly/chi` is quite small (less than 1000 LOC), but we've also\nincluded some useful/optional subpackages: `middleware`, `render` and `docgen`. We hope you enjoy it too!\n\n`go get -u github.com/pressly/chi`\n\n\n## Features\n\n* **Lightweight** - cloc'd in \u003c1000 LOC for the chi router\n* **Fast** - yes, see [benchmarks](#benchmarks)\n* **100% compatible with net/http** - use any http or middleware pkg in the ecosystem that is also compat with `net/http`\n* **Designed for modular/composable APIs** - middlewares, inline middlewares, route groups and subrouter mounting\n* **Context control** - built on new `context` package, providing value chaining, cancelations and timeouts\n* **Robust** - tested / used in production at Pressly.com, and many others\n* **Doc generation** - `docgen` auto-generates routing documentation from your source to JSON or Markdown\n* **No external dependencies** - plain ol' Go 1.7+ stdlib + net/http\n\n\n## Examples\n\n* [rest](https://github.com/pressly/chi/blob/master/_examples/rest/main.go) - REST APIs made easy, productive and maintainable\n* [logging](https://github.com/pressly/chi/blob/master/_examples/logging/main.go) - Easy structured logging for any backend\n* [limits](https://github.com/pressly/chi/blob/master/_examples/limits/main.go) - Timeouts and Throttling\n* [todos-resource](https://github.com/pressly/chi/blob/master/_examples/todos-resource/main.go) - Struct routers/handlers, an example of another code layout style\n* [versions](https://github.com/pressly/chi/blob/master/_examples/versions/main.go) - Demo of `chi/render` subpkg\n* [fileserver](https://github.com/pressly/chi/blob/master/_examples/fileserver/main.go) - Easily serve static files\n* [graceful](https://github.com/pressly/chi/blob/master/_examples/graceful/main.go) - Graceful context signaling and server shutdown\n\n\n**As easy as:**\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"github.com/pressly/chi\"\n)\n\nfunc main() {\n\tr := chi.NewRouter()\n\tr.Get(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(\"welcome\"))\n\t})\n\thttp.ListenAndServe(\":3000\", r)\n}\n```\n\n**REST Preview:**\n\nHere is a little preview of how routing looks like with chi. Also take a look at the generated routing docs\nin JSON ([routes.json](https://github.com/pressly/chi/blob/master/_examples/rest/routes.json)) and in\nMarkdown ([routes.md](https://github.com/pressly/chi/blob/master/_examples/rest/routes.md)).\n\nI highly recommend reading the source of the [examples](#examples) listed above, they will show you all the features\nof chi and serve as a good form of documentation.\n\n```go\nimport (\n  //...\n  \"context\"\n  \"github.com/pressly/chi\"\n  \"github.com/pressly/chi/middleware\"\n)\n\nfunc main() {\n  r := chi.NewRouter()\n\n  // A good base middleware stack\n  r.Use(middleware.RequestID)\n  r.Use(middleware.RealIP)\n  r.Use(middleware.Logger)\n  r.Use(middleware.Recoverer)\n\n  // When a client closes their connection midway through a request, the\n  // http.CloseNotifier will cancel the request context (ctx).\n  r.Use(middleware.CloseNotify)\n\n  // Set a timeout value on the request context (ctx), that will signal\n  // through ctx.Done() that the request has timed out and further\n  // processing should be stopped.\n  r.Use(middleware.Timeout(60 * time.Second))\n\n  r.Get(\"/\", func(w http.ResponseWriter, r *http.Request) {\n    w.Write([]byte(\"hi\"))\n  })\n\n  // RESTy routes for \"articles\" resource\n  r.Route(\"/articles\", func(r chi.Router) {\n    r.With(paginate).Get(\"/\", listArticles)  // GET /articles\n    r.Post(\"/\", createArticle)               // POST /articles\n    r.Get(\"/search\", searchArticles)         // GET /articles/search\n\n    r.Route(\"/:articleID\", func(r chi.Router) {\n      r.Use(ArticleCtx)\n      r.Get(\"/\", getArticle)                 // GET /articles/123\n      r.Put(\"/\", updateArticle)              // PUT /articles/123\n      r.Delete(\"/\", deleteArticle)           // DELETE /articles/123\n    })\n  })\n\n  // Mount the admin sub-router\n  r.Mount(\"/admin\", adminRouter())\n\n  http.ListenAndServe(\":3333\", r)\n}\n\nfunc ArticleCtx(next http.Handler) http.Handler {\n  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    articleID := chi.URLParam(r, \"articleID\")\n    article, err := dbGetArticle(articleID)\n    if err != nil {\n      http.Error(w, http.StatusText(404), 404)\n      return\n    }\n    ctx := context.WithValue(r.Context(), \"article\", article)\n    next.ServeHTTP(w, r.WithContext(ctx))\n  })\n}\n\nfunc getArticle(w http.ResponseWriter, r *http.Request) {\n  ctx := r.Context()\n  article, ok := ctx.Value(\"article\").(*Article)\n  if !ok {\n    http.Error(w, http.StatusText(422), 422)\n    return\n  }\n  w.Write([]byte(fmt.Sprintf(\"title:%s\", article.Title)))\n}\n\n// A completely separate router for administrator routes\nfunc adminRouter() http.Handler {\n  r := chi.NewRouter()\n  r.Use(AdminOnly)\n  r.Get(\"/\", adminIndex)\n  r.Get(\"/accounts\", adminListAccounts)\n  return r\n}\n\nfunc AdminOnly(next http.Handler) http.Handler {\n  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    ctx := r.Context()\n    perm, ok := ctx.Value(\"acl.permission\").(YourPermissionType)\n    if !ok || !perm.IsAdmin() {\n      http.Error(w, http.StatusText(403), 403)\n      return\n    }\n    next.ServeHTTP(w, r)\n  })\n}\n```\n\n\n## Router design\n\nchi's router is based on a kind of [Patricia Radix trie](https://en.wikipedia.org/wiki/Radix_tree).\nThe router is fully compatible with `net/http`.\n\nBuilt on top of the tree is the `Router` interface:\n\n```go\n// Router consisting of the core routing methods used by chi's Mux,\n// using only the standard net/http.\ntype Router interface {\n\thttp.Handler\n\tRoutes\n\n\t// Use appends one of more middlewares onto the Router stack.\n\tUse(middlewares ...func(http.Handler) http.Handler)\n\n\t// With adds inline middlewares for an endpoint handler.\n\tWith(middlewares ...func(http.Handler) http.Handler) Router\n\n\t// Group adds a new inline-Router along the current routing\n\t// path, with a fresh middleware stack for the inline-Router.\n\tGroup(fn func(r Router)) Router\n\n\t// Route mounts a sub-Router along a `pattern`` string.\n\tRoute(pattern string, fn func(r Router)) Router\n\n\t// Mount attaches another http.Handler along ./pattern/*\n\tMount(pattern string, h http.Handler)\n\n\t// Handle and HandleFunc adds routes for `pattern` that matches\n\t// all HTTP methods.\n\tHandle(pattern string, h http.Handler)\n\tHandleFunc(pattern string, h http.HandlerFunc)\n\n\t// HTTP-method routing along `pattern`\n\tConnect(pattern string, h http.HandlerFunc)\n\tDelete(pattern string, h http.HandlerFunc)\n\tGet(pattern string, h http.HandlerFunc)\n\tHead(pattern string, h http.HandlerFunc)\n\tOptions(pattern string, h http.HandlerFunc)\n\tPatch(pattern string, h http.HandlerFunc)\n\tPost(pattern string, h http.HandlerFunc)\n\tPut(pattern string, h http.HandlerFunc)\n\tTrace(pattern string, h http.HandlerFunc)\n\n\t// NotFound defines a handler to respond whenever a route could\n\t// not be found.\n\tNotFound(h http.HandlerFunc)\n}\n\n// Routes interface adds two methods for router traversal, which is also\n// used by the `docgen` subpackage to generation documentation for Routers.\ntype Routes interface {\n\t// Routes returns the routing tree in an easily traversable structure.\n\tRoutes() []Route\n\n\t// Middlewares returns the list of middlewares in use by the router.\n\tMiddlewares() Middlewares\n}\n```\n\nEach routing method accepts a URL `pattern` and chain of `handlers`. The URL pattern\nsupports named params (ie. `/users/:userID`) and wildcards (ie. `/admin/*`).\n\n\n### Middleware handlers\n\nchi's middlewares are just stdlib net/http middleware handlers. There is nothing special\nabout them, which means the router and all the tooling is designed to be compatible and\nfriendly with any middleware in the community. This offers much better extensibility and reuse\nof packages and is at the heart of chi's purpose.\n\nHere is an example of a standard net/http middleware handler using the new request context\navailable in Go 1.7+. This middleware sets a hypothetical user identifier on the request\ncontext and calls the next handler in the chain.\n\n```go\n// HTTP middleware setting a value on the request context\nfunc MyMiddleware(next http.Handler) http.Handler {\n  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    ctx := context.WithValue(r.Context(), \"user\", \"123\")\n    next.ServeHTTP(w, r.WithContext(ctx))\n  })\n}\n```\n\n\n### Request handlers\n\nchi uses standard net/http request handlers. This little snippet is an example of a http.Handler\nfunc that reads a user identifier from the request context - hypothetically, identifying\nthe user sending an authenticated request, validated+set by a previous middleware handler.\n\n```go\n// HTTP handler accessing data from the request context.\nfunc MyRequestHandler(w http.ResponseWriter, r *http.Request) {\n  user := r.Context().Value(\"user\").(string)\n  w.Write([]byte(fmt.Sprintf(\"hi %s\", user)))\n}\n```\n\n\n### URL parameters\n\nchi's router parses and stores URL parameters right onto the request context. Here is\nan example of how to access URL params in your net/http handlers. And of course, middlewares\nare able to access the same information.\n\n```go\n// HTTP handler accessing the url routing parameters.\nfunc MyRequestHandler(w http.ResponseWriter, r *http.Request) {\n  userID := chi.URLParam(r, \"userID\") // from a route like /users/:userID\n\n  ctx := r.Context()\n  key := ctx.Value(\"key\").(string)\n\n  w.Write([]byte(fmt.Sprintf(\"hi %v, %v\", userID, key)))\n}\n```\n\n\n## Middlewares\n\nchi comes equipped with an optional `middleware` package, providing a suite of standard\n`net/http` middlewares. Please note, any middleware in the ecosystem that is also compatible\nwith `net/http` can be used with chi's mux.\n\n--------------------------------------------------------------------------------------------------\n| Middleware   | Description                                                                     |\n|:-------------|:---------------------------------------------------------------------------------\n| RequestID    | Injects a request ID into the context of each request.                          |\n| RealIP       | Sets a http.Request's RemoteAddr to either X-Forwarded-For or X-Real-IP.        |\n| Logger       | Logs the start and end of each request with the elapsed processing time.        |\n| Recoverer    | Gracefully absorb panics and prints the stack trace.                            |\n| NoCache      | Sets response headers to prevent clients from caching.                          |\n| CloseNotify  | Signals to the request context when a client has closed their connection.       |\n| Timeout      | Signals to the request context when the timeout deadline is reached.            |\n| Throttle     | Puts a ceiling on the number of concurrent requests.                            |\n| Compress     | Gzip compression for clients that accept compressed responses.                  |\n| Profiler     | Easily attach net/http/pprof to your routers.                                   |\n| Slashes      | Strip and redirect slashes on routing paths.                                    |\n| WithValue    | Short-hand middleware to set a key/value on the request context.                |\n| Heartbeat    | Monitoring endpoint to check the servers pulse.                                 |\n--------------------------------------------------------------------------------------------------\n\nOther cool net/http middlewares:\n\n* [jwtauth](https://github.com/goware/jwtauth) - JWT authenticator\n* [cors](https://github.com/goware/cors) - CORS middleware\n* [httpcoala](https://github.com/goware/httpcoala) - Request coalescer\n\nplease [submit a PR](./CONTRIBUTING.md) if you'd like to include a link to a chi middleware\n\n\n## context?\n\n`context` is a tiny pkg that provides simple interface to signal context across call stacks\nand goroutines. It was originally written by [Sameer Ajmani](https://github.com/Sajmani)\nand is available in stdlib since go1.7.\n\nLearn more at https://blog.golang.org/context\n\nand..\n* Docs: https://golang.org/pkg/context\n* Source: https://github.com/golang/go/tree/master/src/context\n\n\n## Benchmarks\n\nThe benchmark suite: https://github.com/pkieltyka/go-http-routing-benchmark\n\nComparison with other routers (as of Jan 7/17): https://gist.github.com/pkieltyka/d0814d5396c996cb3ff8076399583d1f\n\n```shell\nBenchmarkChi_Param        \t 5000000\t       398 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_Param5       \t 3000000\t       556 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_Param20      \t 1000000\t      1184 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_ParamWrite   \t 3000000\t       443 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_GithubStatic \t 3000000\t       427 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_GithubParam  \t 3000000\t       565 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_GithubAll    \t   10000\t    122143 ns/op\t   61716 B/op\t     406 allocs/op\nBenchmarkChi_GPlusStatic  \t 5000000\t       383 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_GPlusParam   \t 3000000\t       431 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_GPlus2Params \t 3000000\t       500 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_GPlusAll     \t  200000\t      6410 ns/op\t    3952 B/op\t      26 allocs/op\nBenchmarkChi_ParseStatic  \t 5000000\t       384 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_ParseParam   \t 3000000\t       415 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_Parse2Params \t 3000000\t       450 ns/op\t     304 B/op\t       2 allocs/op\nBenchmarkChi_ParseAll     \t  100000\t     12124 ns/op\t    7904 B/op\t      52 allocs/op\nBenchmarkChi_StaticAll    \t   20000\t     78501 ns/op\t   47731 B/op\t     314 allocs/op\n```\n\nNOTE: the allocs in the benchmark above are from the calls to http.Request's\n`WithContext(context.Context)` method that clones the http.Request, sets the `Context()`\non the duplicated (alloc'd) request and returns it the new request object. This is just\nhow setting context on a request in Go 1.7+ works. \n\n\n## Credits\n\n* Carl Jackson for https://github.com/zenazn/goji\n  * Parts of chi's thinking comes from goji, and chi's middleware package\n    sources from goji.\n* Armon Dadgar for https://github.com/armon/go-radix\n* Contributions: [@VojtechVitek](https://github.com/VojtechVitek)\n\nWe'll be more than happy to see [your contributions](./CONTRIBUTING.md)!\n\n\n## Beyond REST\n\nchi is just a http router that lets you decompose request handling into many smaller layers.\nMany companies including Pressly.com (of course) use chi to write REST services for their public\nAPIs. But, REST is just a convention for managing state via HTTP, and there's a lot of other pieces\nrequired to write a complete client-server system or network of microservices.\n\nLooking ahead beyond REST, I also recommend some newer works in the field coming from\n[gRPC](https://github.com/grpc/grpc-go), [NATS](https://nats.io), [go-kit](https://github.com/go-kit/kit)\nand even [graphql](https://github.com/graphql-go/graphql). They're all pretty cool with their\nown unique approaches and benefits. Specifically, I'd look at gRPC since it makes client-server\ncommunication feel like a single program on a single computer, no need to hand-write a client library\nand the request/response payloads are typed contracts. NATS is pretty amazing too as a super\nfast and lightweight pub-sub transport that can speak protobufs, with nice service discovery - \nan excellent combination with gRPC.\n\n\n## License\n\nCopyright (c) 2015-present [Peter Kieltyka](https://github.com/pkieltyka)\n\nLicensed under [MIT License](./LICENSE)\n\n[GoDoc]: https://godoc.org/github.com/pressly/chi\n[GoDoc Widget]: https://godoc.org/github.com/pressly/chi?status.svg\n[Travis]: https://travis-ci.org/pressly/chi\n[Travis Widget]: https://travis-ci.org/pressly/chi.svg?branch=master\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengsrc%2Fchi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpengsrc%2Fchi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengsrc%2Fchi/lists"}