{"id":15097804,"url":"https://github.com/dicearr/koa-rester","last_synced_at":"2025-10-08T02:31:49.097Z","repository":{"id":118635292,"uuid":"84880566","full_name":"dicearr/koa-rester","owner":"dicearr","description":"Koa library for deploying RESTful APIs easily","archived":true,"fork":false,"pushed_at":"2017-10-12T14:01:45.000Z","size":115,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T06:32:14.974Z","etag":null,"topics":["koa","koa-rester","koa2","koajs","productivity","productivity-booster","rest","rester","restful","restful-api"],"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/dicearr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-03-13T22:27:35.000Z","updated_at":"2023-02-27T02:48:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"269e568b-9900-4cd7-b7d6-cd4f208da43e","html_url":"https://github.com/dicearr/koa-rester","commit_stats":{"total_commits":74,"total_committers":1,"mean_commits":74.0,"dds":0.0,"last_synced_commit":"f9c26f61363fe26b53971681def59a19d13fccef"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dicearr/koa-rester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dicearr%2Fkoa-rester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dicearr%2Fkoa-rester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dicearr%2Fkoa-rester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dicearr%2Fkoa-rester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dicearr","download_url":"https://codeload.github.com/dicearr/koa-rester/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dicearr%2Fkoa-rester/sbom","scorecard":{"id":341004,"data":{"date":"2025-08-11","repo":{"name":"github.com/dicearr/koa-rester","commit":"f9c26f61363fe26b53971681def59a19d13fccef"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"92 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-mh2h-6j8q-x246","Warn: Project is vulnerable to: GHSA-5q88-cjfq-g2mh","Warn: Project is vulnerable to: GHSA-xp63-6vf5-xf3v","Warn: Project is vulnerable to: GHSA-h452-7996-h45h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-9prh-257w-9277","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-4hpf-3wq7-5rpr","Warn: Project is vulnerable to: GHSA-f522-ffg8-j8r6","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-593f-38f6-jp5m","Warn: Project is vulnerable to: GHSA-x2rg-q646-7m2v","Warn: Project is vulnerable to: GHSA-jgmv-j7ww-jx2x","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-7px7-7xjx-hxm8","Warn: Project is vulnerable to: GHSA-x5pg-88wf-qq4p","Warn: Project is vulnerable to: GHSA-p9wx-2529-fp83","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-8225-6cvr-8pqp","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-34r7-q49f-h37c","Warn: Project is vulnerable to: GHSA-c9f4-xj24-8jqx","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T05:52:47.058Z","repository_id":118635292,"created_at":"2025-08-18T05:52:47.058Z","updated_at":"2025-08-18T05:52:47.058Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278877647,"owners_count":26061488,"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-10-08T02:00:06.501Z","response_time":56,"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":["koa","koa-rester","koa2","koajs","productivity","productivity-booster","rest","rester","restful","restful-api"],"created_at":"2024-09-25T16:40:32.439Z","updated_at":"2025-10-08T02:31:48.771Z","avatar_url":"https://github.com/dicearr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-rester\n\n[![Build Status](https://travis-ci.org/dicearr/koa-rester.svg?branch=master)](https://travis-ci.org/dicearr/koa-rester)\n[![Coverage Status](https://coveralls.io/repos/github/dicearr/koa-rester/badge.svg?branch=master)](https://coveralls.io/github/dicearr/koa-rester?branch=master)\n[![dependencies Status](https://david-dm.org/dicearr/koa-rester/status.svg)](https://david-dm.org/dicearr/koa-rester)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1307/badge)](https://bestpractices.coreinfrastructure.org/projects/1307)\n![Downloads](https://img.shields.io/npm/dm/koa-rester.png)\n\n\u003e [Koa](https://github.com/koajs/koa) based framework for deploying RESTful APIs easily. Inspired by [travist/resourcejs](https://github.com/travist/resourcejs).\n\n\n* One line to deploy a REST API from a Model\n* Persistence packages (see [wiki](https://github.com/dicearr/koa-rester/wiki) if you want to create your own)\n  * In memory [dicearr/kr-persistence-inmemory](https://github.com/dicearr/kr-persistence-inmemory)\n  * Mongoose [dicearr/kr-persistence-mongoose](https://github.com/dicearr/kr-persistence-mongoose)\n    * Working examples [dicearr/kr-example-mongoose](https://github.com/dicearr/kr-example-mongoose)\n  * ~~Sequelize [dicearr/kr-persistence-sequelize](https://github.com/dicearr/kr-persistence-sequelize)~~\n* [koa-router](https://github.com/alexmingoia/koa-router/tree/master/) is used internally.\n* Tested with [koa-bodyparser](https://github.com/koajs/bodyparser), other parsers could work.\n* Todo features are listed in [\\#1](https://github.com/dicearr/koa-rester/issues/1)\n\n## Installation\n\n```\n$ npm install koa-rester\n```\n\n\n## Usage\n```javascript\nconst koa = new Koa()\nconst rester = new Rester({\n  persistence: require('kr-persistence-inmemory'),\n})\n\nkoa.use(bodyParser())\n/*\n * GET /name\n * GET /name/:id\n * POST /name\n * PUT /name/:id\n * PATCH /name/:id\n * DELETE /name/:id\n */\nconst nameResource = rester.add(model, 'name').rest()\n/*\n * GET /otherName\n * GET /otherName/:id\n * POST /otherName\n */\nconst otherResource = rester.add(otherModel, 'otherName').get().list().post()\n\nkoa\n  .use(nameResource.routes())\n  .use(nameResource.allowedMethods())\n  .use(otherResource.routes())\n  .use(otherResource.allowedMethods())\n```\n\nMore examples can be found in the [wiki](https://github.com/dicearr/koa-rester/wiki).\n\n## API Reference\n\n## Classes\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#Rester\"\u003eRester\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#Resource\"\u003eResource\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"Rester\"\u003e\u003c/a\u003e\n\n## Rester\n**Kind**: global class  \n\n* [Rester](#Rester)\n    * [new Rester(options)](#new_Rester_new)\n    * [.swagger(options)](#Rester+swagger)\n    * [.add(model, name)](#Rester+add) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n\n\u003ca name=\"new_Rester_new\"\u003e\u003c/a\u003e\n\n### new Rester(options)\nCreate a rester.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e | Configuration object. |\n| options.router | \u003ccode\u003eRouter\u003c/code\u003e | The router to be used, by default koa-router, change this property can break the package. |\n| options.routerOptions | \u003ccode\u003eObject\u003c/code\u003e | The options that will be passed to [koa-router](https://github.com/alexmingoia/koa-router#new_module_koa-router--Router_new) constructor. If options.router is overwritten with any other router this options must be changed according to the new router. |\n| options.logger | \u003ccode\u003efunction\u003c/code\u003e | The logger that will be used |\n| options.persistence | \u003ccode\u003eKoaResterPersistence\u003c/code\u003e | An instance of KoaResterPersistence, such as [kr-presistence-sequelize](https://github.com/dicearr/kr-presistence-sequelize), [kr-persistence-inmemory](https://github.com/dicearr/kr-persistence-inmemory) or [kr-presistence-mongoose](https://github.com/dicearr/kr-presistence-mongoose). This property is compulsory, an error will be thrown if it is not present. |\n\n\u003ca name=\"Rester+swagger\"\u003e\u003c/a\u003e\n\n### rester.swagger(options)\nAdds the required metadata to the Swagger documentation.\n\n**Kind**: instance method of [\u003ccode\u003eRester\u003c/code\u003e](#Rester)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e | Swagger metadata |\n| options.info | \u003ccode\u003eObject\u003c/code\u003e | Global information |\n| options.info.version | \u003ccode\u003eString\u003c/code\u003e | The API version |\n| options.info.title | \u003ccode\u003eString\u003c/code\u003e | The API title |\n| options.info.description | \u003ccode\u003eString\u003c/code\u003e | The API description |\n| options.host | \u003ccode\u003eString\u003c/code\u003e | The API host |\n\n\u003ca name=\"Rester+add\"\u003e\u003c/a\u003e\n\n### rester.add(model, name) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate a Resource configured on top of the rester, this Resource instance\nhas it own Router and KoaResterPersistence instances.\n\n**Kind**: instance method of [\u003ccode\u003eRester\u003c/code\u003e](#Rester)  \n**Returns**: [\u003ccode\u003eResource\u003c/code\u003e](#Resource) - A Resource instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| model | \u003ccode\u003eObject\u003c/code\u003e | A native instance of the supported ORM. If persitence is kr-presistence-mongoose it should be a Mongoose model. |\n| name | \u003ccode\u003eString\u003c/code\u003e | The resource name used to build the resource URI without slashes i.e. 'resourceName'. |\n\n\u003ca name=\"Resource\"\u003e\u003c/a\u003e\n\n## Resource\n**Kind**: global class  \n\n* [Resource](#Resource)\n    * [new Resource(options)](#new_Resource_new)\n    * [.list(options)](#Resource+list) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n    * [.get(options)](#Resource+get) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n    * [.post(options)](#Resource+post) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n    * [.patch(options)](#Resource+patch) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n    * [.put(options)](#Resource+put) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n    * [.delete(options)](#Resource+delete) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n    * [.rest(options)](#Resource+rest) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\n    * [.routes()](#Resource+routes) ⇒ \u003ccode\u003efunction\u003c/code\u003e\n    * [.allowedMethods()](#Resource+allowedMethods) ⇒ \u003ccode\u003efunction\u003c/code\u003e\n\n\u003ca name=\"new_Resource_new\"\u003e\u003c/a\u003e\n\n### new Resource(options)\nShould not be used directly. Build Resource through [Rester.add](#Rester+add).\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e | Configuration options |\n\n\u003ca name=\"Resource+list\"\u003e\u003c/a\u003e\n\n### resource.list(options) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate the GET /resource endpoint in the Resource router.\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e |  |\n| options.before | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed before the list method. |\n| options.after | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed after the list method. |\n\n\u003ca name=\"Resource+get\"\u003e\u003c/a\u003e\n\n### resource.get(options) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate the GET /resource/:id endpoint in the Resource router.\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e |  |\n| options.before | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed before the list method. |\n| options.after | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed after the list method. |\n\n\u003ca name=\"Resource+post\"\u003e\u003c/a\u003e\n\n### resource.post(options) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate the POST /resource endpoint in the Resource router.\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e |  |\n| options.before | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed before the create method. |\n| options.after | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed after the create method. |\n\n\u003ca name=\"Resource+patch\"\u003e\u003c/a\u003e\n\n### resource.patch(options) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate the PATCH /resource/:id endpoint in the Resource router.\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e |  |\n| options.before | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed before the update method. |\n| options.after | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed after the update method. |\n\n\u003ca name=\"Resource+put\"\u003e\u003c/a\u003e\n\n### resource.put(options) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate the PUT /resource/:id endpoint in the Resource router.\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e |  |\n| options.before | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed before the replace method. |\n| options.after | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed after the replace method. |\n\n\u003ca name=\"Resource+delete\"\u003e\u003c/a\u003e\n\n### resource.delete(options) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate the DELETE /resource/:id endpoint in the Resource router.\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e |  |\n| options.before | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed before the delete method. |\n| options.after | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed after the delete method. |\n\n\u003ca name=\"Resource+rest\"\u003e\u003c/a\u003e\n\n### resource.rest(options) ⇒ [\u003ccode\u003eResource\u003c/code\u003e](#Resource)\nCreate all the endpoints\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| options | \u003ccode\u003eObject\u003c/code\u003e | The configuration for all the endpoints |\n| options.before | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed before any method. |\n| options.after | \u003ccode\u003efunction\u003c/code\u003e | The middleware or array of middlewares that will be executed after all the methods. |\n| options.afterList | \u003ccode\u003efunction\u003c/code\u003e | options.after for list() |\n| options.beforeList | \u003ccode\u003efunction\u003c/code\u003e | options.before for list() |\n| options.afterGet | \u003ccode\u003efunction\u003c/code\u003e | options.after for get() |\n| options.beforeGet | \u003ccode\u003efunction\u003c/code\u003e | options.before for get() |\n| options.afterPost | \u003ccode\u003efunction\u003c/code\u003e | options.after for post() |\n| options.beforePost | \u003ccode\u003efunction\u003c/code\u003e | options.before for post() |\n| options.afterPut | \u003ccode\u003efunction\u003c/code\u003e | options.after for put() |\n| options.beforePut | \u003ccode\u003efunction\u003c/code\u003e | options.before for put() |\n| options.afterDelete | \u003ccode\u003efunction\u003c/code\u003e | options.after for delete() |\n| options.beforeDelete | \u003ccode\u003efunction\u003c/code\u003e | options.before for delete() |\n| options.afterPatch | \u003ccode\u003efunction\u003c/code\u003e | options.after for patch() |\n| options.beforePatch | \u003ccode\u003efunction\u003c/code\u003e | options.before for patch() |\n\n\u003ca name=\"Resource+routes\"\u003e\u003c/a\u003e\n\n### resource.routes() ⇒ \u003ccode\u003efunction\u003c/code\u003e\nSugar syntax that returns resource.router.routes()\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n\u003ca name=\"Resource+allowedMethods\"\u003e\u003c/a\u003e\n\n### resource.allowedMethods() ⇒ \u003ccode\u003efunction\u003c/code\u003e\nSugar syntax that returns resource.router.allowedMethods()\n\n**Kind**: instance method of [\u003ccode\u003eResource\u003c/code\u003e](#Resource)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdicearr%2Fkoa-rester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdicearr%2Fkoa-rester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdicearr%2Fkoa-rester/lists"}