{"id":15097697,"url":"https://github.com/chicunic/koa-ts-demo","last_synced_at":"2026-02-24T20:41:05.721Z","repository":{"id":191145422,"uuid":"683886674","full_name":"chicunic/koa-ts-demo","owner":"chicunic","description":"Demo of Koa with TypeScript (tsoa \u0026 swagger UI)","archived":false,"fork":false,"pushed_at":"2024-01-30T06:04:18.000Z","size":279,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-03T14:12:36.791Z","etag":null,"topics":["koa","swagger","tsoa","typescript"],"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/chicunic.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-08-28T01:50:03.000Z","updated_at":"2023-08-30T08:37:15.000Z","dependencies_parsed_at":"2023-08-28T10:55:22.717Z","dependency_job_id":"d1252e27-c942-4035-8955-5bc8b1ef746b","html_url":"https://github.com/chicunic/koa-ts-demo","commit_stats":null,"previous_names":["chicunic/koa-ts-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chicunic/koa-ts-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2Fkoa-ts-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2Fkoa-ts-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2Fkoa-ts-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2Fkoa-ts-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chicunic","download_url":"https://codeload.github.com/chicunic/koa-ts-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2Fkoa-ts-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29799211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T19:56:48.334Z","status":"ssl_error","status_checked_at":"2026-02-24T19:55:43.372Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","swagger","tsoa","typescript"],"created_at":"2024-09-25T16:24:58.756Z","updated_at":"2026-02-24T20:41:05.661Z","avatar_url":"https://github.com/chicunic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-ts-demo\n\nDemo of Koa with TypeScript (tsoa \u0026 swagger UI)\n\n## Usage\n\nStart with development mode:\n\n```bash\npnpm run start:dev\n```\n\nStart with production mode:\n\n```bash\npnpm run start:prod\n```\n\nFormat code:\n\n```bash\npnpm run format\n```\n\nLint code:\n\n```bash\npnpm run lint\n```\n\nBuild code:\n\n```bash\npnpm run build\n```\n\n## Router\n\nHow to add a new router (e.g. `/users`):\n\n1. Create a new file `usersController.ts` in `src/users/` folder. (e.g.`src/users/UsersController.ts`)\n2. Add a new router in `usersController.ts` file with `@Route('users')` decorator.\n3. Add a new class `UsersController` in `usesrsController` folder extends `Controller` class from `tsoa` package.\n4. Use `@Get()` decorator to add a new GET method or use `@Post()` decorator to add a new POST method, etc.\n\n## Swagger\n\nThe swagger.json file is generated by `tsoa` package. The swagger UI is served by `koa2-swagger-ui` package.\n\nHow to generate swagger.json:\n\n```bash\npnpm run build:swagger\n```\n\nThis command will generate `swagger.json` file in `dist/static` folder and `routes.ts` file in `src/routes` folder. Please and these two files to `.gitignore` file and **DO NOT** commit them to git.\n\nThe development mode will generate `swagger.json` and `routes.ts` automatically so you don't need to run this command.\n\nThe `swagger.json` file is used by swagger UI to display the swagger UI page. The `routes.ts` file is used by `@koa/router` in Koa.\n\nIf you want to show the swagger UI page, please visit `http://localhost:8080/api/v1` in your browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicunic%2Fkoa-ts-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchicunic%2Fkoa-ts-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicunic%2Fkoa-ts-demo/lists"}