{"id":15875753,"url":"https://github.com/zimbatm/go-httpresource","last_synced_at":"2025-08-01T23:05:02.660Z","repository":{"id":66382162,"uuid":"182809508","full_name":"zimbatm/go-httpresource","owner":"zimbatm","description":"simple HTTP end-point","archived":false,"fork":false,"pushed_at":"2023-12-15T11:55:42.000Z","size":5,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T10:38:26.486Z","etag":null,"topics":["go","http"],"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/zimbatm.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,"publiccode":null,"codemeta":null}},"created_at":"2019-04-22T14:53:59.000Z","updated_at":"2019-04-24T08:23:57.000Z","dependencies_parsed_at":"2024-10-27T09:03:27.282Z","dependency_job_id":"b875fd1b-c81e-4fd6-9d3b-abf6be263684","html_url":"https://github.com/zimbatm/go-httpresource","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zimbatm/go-httpresource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fgo-httpresource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fgo-httpresource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fgo-httpresource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fgo-httpresource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimbatm","download_url":"https://codeload.github.com/zimbatm/go-httpresource/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fgo-httpresource/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268310702,"owners_count":24230181,"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-01T02:00:08.611Z","response_time":67,"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","http"],"created_at":"2024-10-06T02:00:43.170Z","updated_at":"2025-08-01T23:05:02.607Z","avatar_url":"https://github.com/zimbatm.png","language":"Go","readme":"# go-httpresource - simple HTTP end-point\n\nThe go stdlib `net/http` library is quite good for providing a simple routing\nexperience but some times you want just a bit more. This library is designed\nto work in conjuction and add a dispatch on HTTP methods to the mix. Some\ntimes it's nice to have APIs being a bit more REST-ful-y.\n\n## Example\n\n[$ examples/simple.go](examples/simple.go)\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"github.com/zimbatm/go-httpresource\"\n)\n\nfunc main() {\n\t// Only reply to GET and HEAD requests \n\thttp.Handle(\"/hello\", httpresource.GET(func (w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(\"OK\"))\n\t}))\n\n\t// A more complex example\n\thttp.Handle(\"/users\", httpresource.Resource {\n\t\tGET: http.HandlerFunc(func (w http.ResponseWriter, r *http.Request) {\n\t\t\t// Return the list of all users\n\t\t}),\n\t\tPOST: http.HandlerFunc(func (w http.ResponseWriter, r *http.Request) {\n\t\t\t// Create a new user\n\t\t}),\n\t})\n\n\terr := http.ListenAndServe(\":8080\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n## Related projects\n\n* [Gorilla Mux](https://github.com/gorilla/mux) - A more featureful all-in-one\n  HTTP router\n\n## License\n\nMIT (c) 2019 - zimbatm and contributors\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbatm%2Fgo-httpresource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimbatm%2Fgo-httpresource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbatm%2Fgo-httpresource/lists"}