{"id":21386918,"url":"https://github.com/vbatoufflet/httprouter","last_synced_at":"2025-07-13T15:31:25.982Z","repository":{"id":57492328,"uuid":"72865765","full_name":"vbatoufflet/httprouter","owner":"vbatoufflet","description":"Basic HTTP router for Go","archived":true,"fork":false,"pushed_at":"2020-04-12T13:14:57.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T12:16:58.936Z","etag":null,"topics":["golang","http","router"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vbatoufflet.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":"2016-11-04T16:32:14.000Z","updated_at":"2024-11-06T07:08:09.000Z","dependencies_parsed_at":"2022-09-02T00:21:14.596Z","dependency_job_id":null,"html_url":"https://github.com/vbatoufflet/httprouter","commit_stats":null,"previous_names":["facette/httproute"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vbatoufflet/httprouter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbatoufflet%2Fhttprouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbatoufflet%2Fhttprouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbatoufflet%2Fhttprouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbatoufflet%2Fhttprouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbatoufflet","download_url":"https://codeload.github.com/vbatoufflet/httprouter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbatoufflet%2Fhttprouter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265162791,"owners_count":23720839,"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","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":["golang","http","router"],"created_at":"2024-11-22T12:11:10.132Z","updated_at":"2025-07-13T15:31:25.735Z","avatar_url":"https://github.com/vbatoufflet.png","language":"Go","readme":"# httprouter: HTTP router [![GoDoc][godoc-badge]][godoc-url] [![Travis CI][travis-badge]][travis-url]\n\nBasic HTTP router for Go.\n\n## Example\n\nThe following code:\n\n```go\npackage main\n\nimport (\n        \"fmt\"\n        \"log\"\n        \"net/http\"\n\n        \"batou.dev/httprouter\"\n)\n\nfunc main() {\n        r := httprouter.NewRouter()\n\n        r.Endpoint(\"/foo\").\n                Get(handleFoo).\n                Post(handleFoo)\n        r.Endpoint(\"/bar/:baz\").\n                Get(handleBar)\n        r.Endpoint(\"/*\").\n                Get(handleDefault)\n\n        s := \u0026http.Server{\n                Addr:    \":8080\",\n                Handler: r,\n        }\n\n        err := s.ListenAndServe()\n        if err != nil {\n                log.Fatal(err)\n        }\n}\n\nfunc handleBar(rw http.ResponseWriter, r *http.Request) {\n        fmt.Fprintf(rw, \"Received %q\\n\", httprouter.ContextParam(r, \"baz\").(string))\n}\n\nfunc handleDefault(rw http.ResponseWriter, r *http.Request) {\n        fmt.Fprintln(rw, \"Default here!\")\n}\n\nfunc handleFoo(rw http.ResponseWriter, r *http.Request) {\n        fmt.Fprintf(rw, \"Received %q request\\n\", r.Method)\n}\n```\n\nwill give you:\n\n```\n# curl http://localhost:8080/foo\nReceived \"GET\" request\n\n# curl -X POST http://localhost:8080/foo\nReceived \"POST\" request\n\n# curl http://localhost:8080/bar/baz\nReceived \"baz\"\n\n# curl http://localhost:8080/\nDefault here!\n```\n\n[godoc-badge]: https://godoc.org/batou.dev/httprouter?status.svg\n[godoc-url]: https://godoc.org/batou.dev/httprouter\n[travis-badge]: https://api.travis-ci.org/vbatoufflet/httprouter.svg\n[travis-url]: https://travis-ci.org/vbatoufflet/httprouter\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbatoufflet%2Fhttprouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbatoufflet%2Fhttprouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbatoufflet%2Fhttprouter/lists"}