{"id":21180854,"url":"https://github.com/mariomenjr/handlr","last_synced_at":"2025-08-05T02:05:57.033Z","repository":{"id":41732328,"uuid":"484774416","full_name":"mariomenjr/handlr","owner":"mariomenjr","description":"Easily manage routes and handlers on top of *http.ServeMux.","archived":false,"fork":false,"pushed_at":"2022-05-03T17:14:25.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T11:53:37.565Z","etag":null,"topics":["go","handler","http","router"],"latest_commit_sha":null,"homepage":"","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/mariomenjr.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}},"created_at":"2022-04-23T14:46:54.000Z","updated_at":"2023-03-05T00:57:02.000Z","dependencies_parsed_at":"2022-08-10T12:23:21.904Z","dependency_job_id":null,"html_url":"https://github.com/mariomenjr/handlr","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mariomenjr/handlr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomenjr%2Fhandlr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomenjr%2Fhandlr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomenjr%2Fhandlr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomenjr%2Fhandlr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariomenjr","download_url":"https://codeload.github.com/mariomenjr/handlr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomenjr%2Fhandlr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268820501,"owners_count":24312402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","handler","http","router"],"created_at":"2024-11-20T17:46:15.980Z","updated_at":"2025-08-05T02:05:56.982Z","avatar_url":"https://github.com/mariomenjr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mariomenjr/handlr\n\n[![GoDoc](https://godoc.org/github.com/mariomenjr/handlr?status.svg)](https://godoc.org/github.com/mariomenjr/handlr)\n[![CircleCI](https://circleci.com/gh/mariomenjr/handlr/tree/main.svg?style=svg)](https://circleci.com/gh/mariomenjr/handlr/tree/main)\n\nEasily manage routes and handlers on top of *http.ServeMux.\n\n---\n\n## Install\n\nAs you would do with almost any other Go package.\n\n```bash\ngo get -u github.com/mariomenjr/handlr\n```\n\n---\n\n## Examples\n\n### Handlers\n\nYou can register paths and handlers directly:\n\n```go\n// main.go\n\nfunc main() {\n\th := handlr.New()\n\n\th.HandleFunc(\"/feed\", feedHandler)\n\n\tr.Start(1993)\n}\n\nfunc feedHandler(w http.ResponseWriter, r *http.Request) {\n\t// ...\n}\n```\n\n### Routes\n\nYou can also register `Route`s which allow you to organize your handlers (or even sub-Routes) into multiple files in an elegant way.\n\n```\n├── main.go\n├── feed.route.go\n├── acccount.route.go\n```\n\n```go\n// main.go\n\nfunc main() {\n\th := handlr.New()\n\n\th.RouteFunc(\"/feed\", feedRoute)\n\th.RouteFunc(\"/account\", accountRoute)\n\t\n\tr.Start(1993)\n}\n```\n\n```go\n// feed.route.go\n\nfunc feedRoute(r *handlr.Router) {\n\tr.HandleFunc(\"/latest\", latestHandler)\n\n\tr.RouteFunc(\"/custom\", feedCustomRoute)\n}\n\nfunc latestHandler(w http.ResponseWriter, r *http.Request) {\n\t// ...\n}\n\nfunc feedCustomRoute(r *handlr.Router) {\n\tr.HandleFunc(\"/monthly\", feedCustomMonthlyHandler)\n}\n\nfunc feedCustomMonthlyHandler(w http.ResponseWriter, r *http.Request) {\n\t// ...\n}\n```\n\n```go\n// account.route.go\n\nfunc accountRoute(r *handlr.Router) {\n\tr.HandleFunc(\"/profile\", accountProfileHandlr)\n\tr.HandleFunc(\"/settings\", accountSettingsHandlr)\n}\n\nfunc accountProfileHandlr(w http.ResponseWriter, r *http.Request) {\n\t// ...\n}\n\nfunc accountSettingsHandlr(w http.ResponseWriter, r *http.Request) {\n\t// ...\n}\n```\n\n---\n\n## License \nThe source code of this project is under [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomenjr%2Fhandlr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariomenjr%2Fhandlr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomenjr%2Fhandlr/lists"}