{"id":21033724,"url":"https://github.com/metowolf/koa-router-semver","last_synced_at":"2026-05-17T02:49:06.958Z","repository":{"id":97325083,"uuid":"289823820","full_name":"metowolf/koa-router-semver","owner":"metowolf","description":"🍌 Semver Version Router middleware for Koa.","archived":false,"fork":false,"pushed_at":"2020-08-27T01:34:34.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T20:15:22.416Z","etag":null,"topics":["koa","router","semver"],"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/metowolf.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-24T04:00:37.000Z","updated_at":"2020-08-26T13:20:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"b25c5bcb-c746-485b-abbc-5f52ca3e6378","html_url":"https://github.com/metowolf/koa-router-semver","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"862ba1cef6db76b4a860ec511f6c80c3a709b103"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/metowolf/koa-router-semver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metowolf%2Fkoa-router-semver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metowolf%2Fkoa-router-semver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metowolf%2Fkoa-router-semver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metowolf%2Fkoa-router-semver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metowolf","download_url":"https://codeload.github.com/metowolf/koa-router-semver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metowolf%2Fkoa-router-semver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260759804,"owners_count":23058488,"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":["koa","router","semver"],"created_at":"2024-11-19T12:59:19.541Z","updated_at":"2025-10-10T10:35:48.928Z","avatar_url":"https://github.com/metowolf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [koa-router-semver](https://github.com/metowolf/koa-router-semver)\n\n\u003e Semver Version Router middleware for [Koa](https://github.com/koajs/koa).\n\n* [Semantic Versioning](http://semver.org/) routes\n* Multiple version middleware\n* Support for Header, search query and path params\n\n## Installation\n\n```bash\n# npm .. \nnpm i koa-router-semver\n# yarn .. \nyarn add koa-router-semver\n```\n\n## Usage\n\nServer\n```js\nconst Koa = require('koa')\nconst Router = require('@koa/router')\nconst SemverRouter = require('koa-router-semver')\n\nconst app = new Koa()\nconst router = new Router()\nconst semver = new SemverRouter()\n\nrouter.get('index', '/', semver.version({\n  '1.0.0': (ctx) =\u003e { ctx.body = 'Hello World!' },\n  '1.1.0': (ctx) =\u003e { ctx.body = 'Hello Koa.js!' }\n}))\n\napp.use(router.routes())\n\napp.listen(3000)\n```\n\nClient\n```bash\n# Specifying a version\n$ curl -i -H \"Accept-Version: 1.0.0\" http://localhost:3000/\nHTTP/1.1 200 OK\nx-api-version: 1.0.0\n\u003cmore headers\u003e\n\nHello World!\n\n# Hyphen Ranges version\n$ curl -i -H \"Accept-Version: \u003e1.0.0\" http://localhost:3000/\nHTTP/1.1 200 OK\nx-api-version: 1.1.0\n\u003cmore headers\u003e\n\nHello Koa.js!\n\n# Caret Ranges version\n$ curl -i -H \"Accept-Version: ^1.0\" http://localhost:3000/\nHTTP/1.1 200 OK\nx-api-version: 1.1.0\n\u003cmore headers\u003e\n\nHello Koa.js!\n```\n\n## Contributing\n\nPlease submit all issues and pull requests to the [metowolf/koa-router-semver](https://github.com/metowolf/koa-router-semver) repository!\n\n## Support\n\nIf you have any problem or suggestion please open an issue [here](https://github.com/metowolf/koa-router-semver/issues).\n\n\n### License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetowolf%2Fkoa-router-semver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetowolf%2Fkoa-router-semver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetowolf%2Fkoa-router-semver/lists"}