{"id":30044702,"url":"https://github.com/tomiok/webh","last_synced_at":"2025-08-07T06:45:18.506Z","repository":{"id":176690450,"uuid":"658146229","full_name":"tomiok/webh","owner":"tomiok","description":"Webh is a self contained library that has a production ready web server with all the capabilities, ready to use. Including safe start-shutdown, middlewares and handy error management","archived":false,"fork":false,"pushed_at":"2024-05-21T19:52:45.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-07T16:36:33.056Z","etag":null,"topics":["golang","library","mux-router","server","web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomiok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-24T23:13:54.000Z","updated_at":"2024-05-21T19:40:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"c42e0c2c-43f1-46a5-bdc7-2874fefffe83","html_url":"https://github.com/tomiok/webh","commit_stats":null,"previous_names":["tomiok/webh"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tomiok/webh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fwebh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fwebh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fwebh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fwebh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomiok","download_url":"https://codeload.github.com/tomiok/webh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fwebh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269213683,"owners_count":24379498,"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-07T02:00:09.698Z","response_time":73,"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":["golang","library","mux-router","server","web"],"created_at":"2025-08-07T06:45:14.096Z","updated_at":"2025-08-07T06:45:18.473Z","avatar_url":"https://github.com/tomiok.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/tomiok/webh?style=for-the-badge)](https://github.com/tomiok/webh/blob/master/LICENSE)\n\n# webh, the web helper for Golang\n\n## Include web code snippets for speed up the development.\n\n\nThis is a tiny yet powerful library was built for do not write every single\ntime the web server.\n\nWe provide several capabilities used in the industry like\nmiddlewares, graceful shutdown, logging, ability to unwrap web handlers that return an\nerror in order to avoid weird returns.\n\nA clean mechanism to log errors among the http requests.\n\nEncoder and Decoder for JSON.\n\nA custom error type for web purposes.\n\nThe Server is created on top of [chi](https://go-chi.io) web library, so will have all\nthe same features and ways to declare endpoints.\n\n\nHeartbeat at `/ping` is already declared for you, among recover and logger. Do not worry to add them.\n\n### Installation\n\n```shell\ngo get -u github.com/tomiok/webh\n```\n\n### Create and start the server with one endpoint.\n```go\ns := webh.NewServer(\"8080\", webh.WithLogger(\"hello\"), webh.WithHeartbeat(\"/ping\"))\n\ns.Get(\"/hello\", func(w http.ResponseWriter, r *http.Request){\n\t//.....\n})\n\ns.Start()\n```\n\nor use a custom handler returning an error.\n\n```go\npackage web\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc HelloHandler(w http.ResponseWriter, r *http.Request) error {\n\t_, err := fmt.Fprint(w, \"hello\")\n\treturn err\n}\n```\n```go\npackage main\n\nimport \"github.com/tomiok/webh\"\n\nfunc main() {\n\ts := webh.NewServer(\"8080\", webh.WithLogger(\"hello\"), webh.WithHeartbeat(\"/ping\"))\n\n\ts.Get(\"/hello\", webh.Unwrap(HelloHandler))\n\n\ts.Start()\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomiok%2Fwebh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomiok%2Fwebh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomiok%2Fwebh/lists"}