{"id":16641846,"url":"https://github.com/samthor/nicehttp","last_synced_at":"2025-06-30T06:35:03.059Z","repository":{"id":57507246,"uuid":"193467011","full_name":"samthor/nicehttp","owner":"samthor","description":"Convenience library for HTTP handlers in Go","archived":false,"fork":false,"pushed_at":"2020-02-13T23:58:06.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T22:23:57.962Z","etag":null,"topics":["golang","golang-library","http"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/samthor/nicehttp","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samthor.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":"2019-06-24T08:38:37.000Z","updated_at":"2023-12-31T21:42:24.000Z","dependencies_parsed_at":"2022-09-04T13:50:09.654Z","dependency_job_id":null,"html_url":"https://github.com/samthor/nicehttp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/samthor/nicehttp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fnicehttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fnicehttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fnicehttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fnicehttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samthor","download_url":"https://codeload.github.com/samthor/nicehttp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fnicehttp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262724502,"owners_count":23354260,"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","golang-library","http"],"created_at":"2024-10-12T07:48:04.712Z","updated_at":"2025-06-30T06:35:03.033Z","avatar_url":"https://github.com/samthor.png","language":"Go","readme":"Convenience library for HTTP handlers in Go.\nThese help [@samthor](https://twitter.com/samthor) write servers.\nYMMV.\n\nSee [the godoc](https://godoc.org/github.com/samthor/nicehttp) for documentation.\n\n## Convenience handler type\n\nThe core `Handler` type looks like this and implements `http.Handler`:\n\n```go\ntype Handler func(ctx context.Context, r *http.Request) interface{}\n```\n\nAs you write HTTP handlers, you can just return a variety of types to have your HTTP server do something sensible.\nIf you return an `error`, the server will serve a 500 and `log` the error.\n\nSee [the godoc](https://godoc.org/github.com/samthor/nicehttp#Handler) for more supported types.\n\nYes, this prevents static type checking for your HTTP handlers.\nYes, the convenience is worth it.\n\n## App Engine\n\nThe `dev_appserver` script seems to be going away for runtimes of `go112` and beyond, which means your program will no longer read its \"app.yaml\" in development.\nStatic handlers will still work in production ¯‍\\‍_‍(‍ツ‍)‍_‍/‍¯\n\nRun `nicehttp.Serve(\"app.yaml\", nil)` to host your application with:\n\n* static handler support in development, and\n* automatic serving on the environment variable `PORT`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Fnicehttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamthor%2Fnicehttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Fnicehttp/lists"}