{"id":29117221,"url":"https://github.com/jvcoutinho/lit","last_synced_at":"2026-01-12T00:33:22.651Z","repository":{"id":158943070,"uuid":"634256025","full_name":"jvcoutinho/lit","owner":"jvcoutinho","description":"A simple, fast and expressive HTTP framework for Go.","archived":false,"fork":false,"pushed_at":"2024-02-27T02:42:14.000Z","size":172,"stargazers_count":30,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T11:14:19.226Z","etag":null,"topics":["framework","go","golang","http","http-server"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/jvcoutinho/lit","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jvcoutinho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-29T14:45:40.000Z","updated_at":"2025-05-19T16:28:03.000Z","dependencies_parsed_at":"2024-02-18T11:31:13.300Z","dependency_job_id":null,"html_url":"https://github.com/jvcoutinho/lit","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/jvcoutinho/lit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvcoutinho%2Flit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvcoutinho%2Flit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvcoutinho%2Flit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvcoutinho%2Flit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvcoutinho","download_url":"https://codeload.github.com/jvcoutinho/lit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvcoutinho%2Flit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28329800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:13:06.322Z","status":"ssl_error","status_checked_at":"2026-01-12T00:04:50.725Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["framework","go","golang","http","http-server"],"created_at":"2025-06-29T11:14:17.248Z","updated_at":"2026-01-12T00:33:22.637Z","avatar_url":"https://github.com/jvcoutinho.png","language":"Go","funding_links":[],"categories":["Web Frameworks","Web框架"],"sub_categories":["Utility/Miscellaneous","实用程序/Miscellaneous"],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/jvcoutinho/lit.svg)](https://pkg.go.dev/github.com/jvcoutinho/lit)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jvcoutinho/lit)](https://goreportcard.com/report/github.com/jvcoutinho/lit)\n[![codecov](https://codecov.io/github/jvcoutinho/lit/graph/badge.svg?token=65B6W5I6GG)](https://codecov.io/github/jvcoutinho/lit)\n\n# Lit 🔥\n\nLit is an expressive and fast HTTP framework for Golang. It aims to enhance development by\nproviding great simplicity, extensibility and maintainability.\n\n## Documentation\n\nCheck [Lit](https://pkg.go.dev/github.com/jvcoutinho/lit#section-documentation) documentation.\n\n## Getting started\n\nCreate a new Go project and import Lit with the command:\n\n```\ngo get github.com/jvcoutinho/lit\n```\n\nWrite this to your `main.go` file:\n\n```go\npackage main\n\nimport (\n  \"log\"\n  \"net/http\"\n\n  \"github.com/jvcoutinho/lit\"\n  \"github.com/jvcoutinho/lit/render\"\n)\n\nfunc main() {\n  r := lit.NewRouter()\n  r.Use(lit.Log)\n  r.Use(lit.Recover)\n\n  r.GET(\"/\", HelloWorld)\n\n  server := http.Server{Addr: \":8080\", Handler: r}\n  log.Fatalln(server.ListenAndServe())\n}\n\nfunc HelloWorld(r *lit.Request) lit.Response {\n  return render.OK(\"Hello, World!\")\n}\n```\n\nThen you can start adding new routes and middlewares.\n\n## Features\n\n- **Speed and efficiency**: It uses [httprouter](https://github.com/julienschmidt/httprouter), a very fast\n  zero-allocation\n  router. See benchmarks.\n- **Expressiveness**: Its constructs make room for declarative programming, creating code that is more readable,\n  maintainable, extensible and testable.\n- **Flexibility**: It allows one to easily extend its constructs. Creating new validations, middlewares and responses,\n  for example, is very simple and intuitive.\n- **Idiomatic**: It uses latest Go features, such as generics, in order to build a framework that is elegant to code.\n\nCheck an example of [`lit.Handler`](https://go.dev/play/p/pbSkMBvwC0w) vs [`http.Handler`](https://go.dev/play/p/XcsDDrrcjyU).\n\n## Benchmarks\n\nThe instances below were tested with the specifications:\n\n```\ngoos: windows\ngoarch: amd64\npkg: github.com/julienschmidt/go-http-routing-benchmark\ncpu: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz\n```\n\nYou can check the methodology or try yourself with\n[go-http-routing-benchmark](https://github.com/jvcoutinho/go-http-routing-benchmark).\n\n### GitHub API\n\n| Router      | Memory for handler registration | Number repetitions | Latency per repetition | Heap memory per repetition | Allocations per repetition |\n|-------------|---------------------------------|--------------------|------------------------|----------------------------|----------------------------|\n| Chi         | 94888 B                         | 10000              | 105680 ns/op           | 61713 B/op                 | 406 allocs/op              |\n| Gin         | 94888 B                         | 84152              | 14056 ns/op            | 0 B/op                     | 0 allocs/op                |\n| **Lit**  🔥 | **42088 B**                     | **65989**          | **17919 ns/op**        | **0 B/op**                 | **0 allocs/op**            |\n| Gorilla     | 1319632 B                       | 612                | 1886488 ns/op          | 199684 B/op                | 1588 allocs/op             |\n| HttpRouter  | 37136 B                         | 114933             | 10511 ns/op            | 0 B/op                     | 0 allocs/op                |\n| Martini     | 485032 B                        | 596                | 2070638 ns/op          | 231420 B/op                | 2731 allocs/op             |\n\n### Parse API\n\n| Router      | Memory for handler registration | Number repetitions | Latency per repetition | Heap memory per repetition | Allocations per repetition |\n|-------------|---------------------------------|--------------------|------------------------|----------------------------|----------------------------|\n| Chi         | 9656 B                          | 315666             | 11549 ns/op            | 7904 B/op                  | 52 allocs/op               |\n| Gin         | 7864 B                          | 3118021            | 1144 ns/op             | 0 B/op                     | 0 allocs/op                |\n| **Lit**  🔥 | **5776 B**                      | **2670331**        | **1342 ns/op**         | **0 B/op**                 | **0 allocs/op**            |\n| Gorilla     | 105448 B                        | 75290              | 47507 ns/op            | 23632 B/op                 | 198 allocs/op              |\n| HttpRouter  | 5072 B                          | 4421617            | 816 ns/op              | 0 B/op                     | 0 allocs/op                |\n| Martini     | 45808 B                         | 45362              | 79979 ns/op            | 25696 B/op                 | 305 allocs/op              |\n\n### Fake API (only static routes)\n\n| Router      | Memory for handler registration | Number repetitions | Latency per repetition | Heap memory per repetition | Allocations per repetition |\n|-------------|---------------------------------|--------------------|------------------------|----------------------------|----------------------------|\n| Chi         | 83160 B                         | 51685              | 69608 ns/op            | 47728 B/op                 | 314 allocs/op              |\n| Gin         | 34344 B                         | 385328             | 9302 ns/op             | 0 B/op                     | 0 allocs/op                |\n| **Lit**  🔥 | **25560 B**                     | **450072**         | **7944 ns/op**         | **0 B/op**                 | **0 allocs/op**            |\n| Gorilla     | 582536 B                        | 7695               | 500949 ns/op           | 113042 B/op                | 1099 allocs/op             |\n| HttpRouter  | 21712 B                         | 638422             | 5716 ns/op             | 0 B/op                     | 0 allocs/op                |\n| Martini     | 309880 B                        | 3915               | 916608 ns/op           | 129211 B/op                | 2031 allocs/op             |\n\nAs seen, Lit consumes less memory to register a batch of routes and has performance comparable to the top performers,\nsuch as Gin Gonic and HttpRouter.\n\n## Contributing\n\nFeel free to open issues or pull requests!\n\n---\n\nCopyright (c) 2023-2024\n\nJoão Victor de Sá Ferraz Coutinho \u003cjoao.coutinho9@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvcoutinho%2Flit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvcoutinho%2Flit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvcoutinho%2Flit/lists"}