{"id":15097681,"url":"https://github.com/sombriks/koa-api-builder","last_synced_at":"2026-01-06T23:05:15.443Z","repository":{"id":190838029,"uuid":"683428586","full_name":"sombriks/koa-api-builder","owner":"sombriks","description":"Helper to build koa-router apis easily","archived":false,"fork":false,"pushed_at":"2023-12-29T17:11:55.000Z","size":187,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T17:44:30.146Z","etag":null,"topics":["api-builder","koa","koa-router","node"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/sombriks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["sombriks"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-08-26T14:46:11.000Z","updated_at":"2024-05-14T17:18:29.000Z","dependencies_parsed_at":"2023-12-29T18:36:36.061Z","dependency_job_id":null,"html_url":"https://github.com/sombriks/koa-api-builder","commit_stats":null,"previous_names":["sombriks/koa-api-builder"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fkoa-api-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fkoa-api-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fkoa-api-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fkoa-api-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sombriks","download_url":"https://codeload.github.com/sombriks/koa-api-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245853884,"owners_count":20683264,"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":["api-builder","koa","koa-router","node"],"created_at":"2024-09-25T16:24:48.776Z","updated_at":"2026-01-06T23:05:15.424Z","avatar_url":"https://github.com/sombriks.png","language":"JavaScript","readme":"# [Koa-api-builder](https://github.com/sombriks/koa-api-builder)\n\n![tests and coverage](https://github.com/sombriks/koa-api-builder/actions/workflows/node.js.yml/badge.svg)\n[![npm version](https://img.shields.io/npm/v/koa-api-builder?style=plastic)](https://www.npmjs.com/package/koa-api-builder)\n[![license](https://img.shields.io/github/license/sombriks/koa-api-builder.svg)](LICENSE)\n\nHelper to build [koa-router](https://github.com/koajs/router) apis easily\n\n## Dependencies\n\n- node 14 or higher\n- koa-router\n- koa\n\n## Sample usage\n\n```javascript\nimport ApiBuilder from \"koa-api-builder\";\n\nconst group = new ApiBuilder().path((group) =\u003e {\n  group.post('/login', loginRequest)\n    .post('/signup', signupRequest)\n    .path('/user/:userId/accounts', ifAuthenticated, (group) =\u003e {\n      group.get(listAccountsRequest)\n        .post(ifAllowed, insertAccountRequest)\n        .path('/:accountId', (group) =\u003e {\n          group.get(findAccountRequest);\n          group.put(updateAccountRequest);\n          group.del(ifAllowed, delAccountRequest);\n          group.get('/transactions', listTransactionsRequest);\n        });\n    });\n});\n\n// then we build our api definition into a regular koa-router\nconst router = group.build();\n```\n\n## Similar libraries\n\nSee router section on [koa wiki](https://github.com/koajs/koa/wiki#routing-and-mounting)\n\n## Inspiration\n\nThis api builder is heavily copied from [Javalin's group handler](https://javalin.io/documentation#handler-groups)\n\n## Roadmap\n\n- [X] Initial implementation\n- [X] Test and coverage\n- [X] Publish npm package\n- [X] Add linting tool\n- [X] Publish every new tag\n- [ ] Publish coverage results\n- [ ] ~~Add special `render` pseudo-verb for template engines~~\n- [ ] Add Server Sent Events configuration support\n- [ ] Add WebSockets configuration support\n\nSee the [changelog](CHANGELOG.md) for more details\n","funding_links":["https://github.com/sponsors/sombriks"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fkoa-api-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsombriks%2Fkoa-api-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fkoa-api-builder/lists"}