{"id":13736265,"url":"https://github.com/JohannLai/doa","last_synced_at":"2025-05-08T12:32:31.642Z","repository":{"id":55518162,"uuid":"269516434","full_name":"JohannLai/doa","owner":"JohannLai","description":"A middleware framework for Deno's http serve🦕. Transplanted from Koa with ❤️","archived":false,"fork":false,"pushed_at":"2020-12-24T09:48:54.000Z","size":212,"stargazers_count":23,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T12:06:43.347Z","etag":null,"topics":["deno","framework","koa","middleware","performance","rest-api","server","typescript","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/JohannLai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-05T02:52:58.000Z","updated_at":"2022-10-23T19:57:43.000Z","dependencies_parsed_at":"2022-08-15T02:11:01.234Z","dependency_job_id":null,"html_url":"https://github.com/JohannLai/doa","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohannLai%2Fdoa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohannLai%2Fdoa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohannLai%2Fdoa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohannLai%2Fdoa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohannLai","download_url":"https://codeload.github.com/JohannLai/doa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253068924,"owners_count":21848890,"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":["deno","framework","koa","middleware","performance","rest-api","server","typescript","web"],"created_at":"2024-08-03T03:01:18.467Z","updated_at":"2025-05-08T12:32:31.045Z","avatar_url":"https://github.com/JohannLai.png","language":"TypeScript","funding_links":[],"categories":["基础设施"],"sub_categories":["Deno 源"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"/docs/logo.png\" alt=\"Doa middleware framework for deno\"/\u003e\n\n[![Github Action Status](https://github.com/JohannLai/doa/workflows/build/badge.svg)](https://github.com/JohannLai/doa/actions)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![GitHub license](https://img.shields.io/github/license/JohannLai/doa)](https://github.com/JohannLai/doa/blob/master/LICENSE)\n[![tag](https://img.shields.io/badge/deno-1.1.3-green.svg)](https://github.com/denoland/deno)\n[![tag](https://img.shields.io/badge/std-0.59.0-green.svg)](https://github.com/denoland/deno)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nA middleware framework for Deno's http serve. Transplanted from Koa.\n\n\u003c/div\u003e\n\n## ⚡️ Quick start\n\nA basic usage, responding to every request with *Hello World*;\n\n```js\nimport { App } from \"https://deno.land/x/doa/mod.ts\";\n\nconst app = new App();\n\napp.use(async ctx =\u003e {\n  ctx.status = 200;\n  ctx.body = \"Hello World\";\n});\n\napp.listen({ port: 8000 });\n```\n\nAdding middlewares through `app.use(middleware)`, will cause all of the middlewares to be executed upon each request in the specified order. When you call the middleware, it passed the context and next method in the stack.\n\nA more complex example with [responseTime middleware](https://github.com/JohannLai/response-time), which will add `x-response-time` in the response header:\n\n```js\nimport { App } from \"https://deno.land/x/doa/mod.ts\";\nimport { responseTime } from \"https://deno.land/x/response-time/mod.ts\";\n\nconst app = new App();\n\napp.use(responseTime());\n\napp.use(async ctx =\u003e {\n  ctx.status = 200;\n  ctx.body = \"Hello World\";\n});\n\napp.listen({ port: 8000 });\n\n```\n\n## 📑 docs\nFor more information see https://koajs.com/.\n\n## 🧪 Running tests\n\nMore than 199 test cases（ over 90% ） to ensure code quality.\n\n```bash\n$ deno test --allow-read --allow-write --allow-net --allow-hrtime  \n\n# test result: ok. 199 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (715ms)\n```\n\n## 🚀 Running benchmarks\nUse [wrk](https://github.com/wg/wrk) to benchmark doa.\n\n```bash\n$ deno run --allow-net --allow-env  ./example.ts\n$ make -C benchmarks \n```\n\n## 🎯 Trouble Shooting\n\nMake sure you are using **deno 1.1.3** and **std 0.59.0.**  Doa will continue to update deno to the latest version later. \n\n## License\n\n[MIT](https://github.com/JohannLai/doa/blob/master/LICENSE)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/JohannLai\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/10769405?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJohannLai\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/JohannLai/doa/commits?author=JohannLai\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohannLai%2Fdoa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJohannLai%2Fdoa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohannLai%2Fdoa/lists"}