{"id":16454132,"url":"https://github.com/sfantasy/pugna","last_synced_at":"2025-09-19T07:06:25.990Z","repository":{"id":65478604,"uuid":"64387558","full_name":"SFantasy/pugna","owner":"SFantasy","description":"An Extensible Node.js Web Architecture","archived":false,"fork":false,"pushed_at":"2016-07-29T11:35:10.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T09:24:12.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/SFantasy.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}},"created_at":"2016-07-28T10:47:01.000Z","updated_at":"2023-03-10T09:59:12.000Z","dependencies_parsed_at":"2023-01-25T07:55:12.372Z","dependency_job_id":null,"html_url":"https://github.com/SFantasy/pugna","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SFantasy/pugna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFantasy%2Fpugna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFantasy%2Fpugna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFantasy%2Fpugna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFantasy%2Fpugna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SFantasy","download_url":"https://codeload.github.com/SFantasy/pugna/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SFantasy%2Fpugna/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262102788,"owners_count":23259331,"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":[],"created_at":"2024-10-11T10:18:08.073Z","updated_at":"2025-09-19T07:06:20.938Z","avatar_url":"https://github.com/SFantasy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pugna\n---\n\n[![NPM version][npm-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/pugna.svg?style=flat\n[npm-url]: https://npmjs.org/package/pugna\n\nAn Extensible Node.js Web Architecture\n\n## Install\n\n```sh\nnpm i pugna -S\n```\n\n## Usage\n\nPugna extends [Koa2](https://github.com/koajs/koa#koa-v2) and you can use it same as Koa: \n\n```js\nconst Pugna = require('pugna');\nconst app = new Pugna();\n\napp.use(ctx =\u003e {\n  ctx.body = 'Hello Pugna!';\n});\n```\n\n### `loadModules`\n\nPugna provides a function for dynamic loading modules:\n\n```js\napp.loadModules(app, __dirname);\n```\n\n### Appointment\n\nUsing `loadModules` should have the following appointment:\n\n- Use `koa-router`\n- Each module's name would be used in the application's route rules\n- Each module should have `routes` folder and exports the router:\n\n```js\nconst router = require('koa-router')();\n\nrouter.get('/', (ctx, next) =\u003e {\n  ctx.body = 'bar index';\n});\n\nmodule.exports = router;\n```\n\n## Example\n\nSee [example](/example).\n\n## License\n\nThe [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfantasy%2Fpugna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsfantasy%2Fpugna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfantasy%2Fpugna/lists"}