{"id":13779543,"url":"https://github.com/potatogopher/koa-response-handler","last_synced_at":"2025-07-29T16:11:27.887Z","repository":{"id":52753870,"uuid":"93087870","full_name":"potatogopher/koa-response-handler","owner":"potatogopher","description":"Lightweight response handler for Koa JS","archived":false,"fork":false,"pushed_at":"2018-10-12T15:54:00.000Z","size":21,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T07:13:40.395Z","etag":null,"topics":["es6","javascript","koa-router","koajs","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/potatogopher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-01T18:32:52.000Z","updated_at":"2025-01-11T00:22:09.000Z","dependencies_parsed_at":"2022-08-22T19:20:38.922Z","dependency_job_id":null,"html_url":"https://github.com/potatogopher/koa-response-handler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/potatogopher/koa-response-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potatogopher%2Fkoa-response-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potatogopher%2Fkoa-response-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potatogopher%2Fkoa-response-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potatogopher%2Fkoa-response-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potatogopher","download_url":"https://codeload.github.com/potatogopher/koa-response-handler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potatogopher%2Fkoa-response-handler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267717837,"owners_count":24133425,"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-07-29T02:00:12.549Z","response_time":2574,"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":["es6","javascript","koa-router","koajs","nodejs"],"created_at":"2024-08-03T18:01:06.299Z","updated_at":"2025-07-29T16:11:27.813Z","avatar_url":"https://github.com/potatogopher.png","language":"JavaScript","funding_links":[],"categories":["Middleware"],"sub_categories":[],"readme":"# koa-response-handler\nResponse handler middleware for [koa](https://github.com/koajs/koa).\n\n\u003ca href=\"https://communityinviter.com/apps/koa-js/koajs\" rel=\"KoaJs Slack Community\"\u003e![KoaJs Slack](https://img.shields.io/badge/Koa.Js-Slack%20Channel-Slack.svg?longCache=true\u0026style=for-the-badge)\u003c/a\u003e\n\n## Installation\n```js\n$ yarn add koa-response-handler\n```\n## Example\n```js\nimport Koa from 'koa'  \nimport Router from 'koa-router'  \nimport responseHandler from 'koa-response-handler'\n\nconst app = new Koa()  \nconst router = new Router()\n\napp  \n  .use(responseHandler({ contentType: 'application/json' }))\n  .use(router.routes())\n  .use(router.allowedMethods())\n\nrouter.get('/:id', function async (ctx, next) {  \n    let data = {id: 1, hello: 'world' }\n\n    if (ctx.params.id !== data.id) {\n      ctx.response.notFound()\n      return\n    }\n\n    ctx.response.ok(data)\n})\n```\n\n## License\n  MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatogopher%2Fkoa-response-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotatogopher%2Fkoa-response-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatogopher%2Fkoa-response-handler/lists"}