{"id":19199920,"url":"https://github.com/paveldeuce/router","last_synced_at":"2025-07-13T23:08:59.263Z","repository":{"id":49612669,"uuid":"488569754","full_name":"PavelDeuce/router","owner":"PavelDeuce","description":"Lightweight library to provide an API for handling routes","archived":false,"fork":false,"pushed_at":"2022-08-15T20:43:45.000Z","size":121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T23:02:26.665Z","etag":null,"topics":["algorithm","algorithms","constraints","eslint-prettier","jest","jsdoc","methods","rest-api","router","routes","tree","tree-structure","trie","trie-tree"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PavelDeuce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-04T11:56:59.000Z","updated_at":"2022-08-15T19:57:41.000Z","dependencies_parsed_at":"2022-08-12T20:20:29.488Z","dependency_job_id":null,"html_url":"https://github.com/PavelDeuce/router","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/PavelDeuce/router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDeuce%2Frouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDeuce%2Frouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDeuce%2Frouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDeuce%2Frouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PavelDeuce","download_url":"https://codeload.github.com/PavelDeuce/router/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelDeuce%2Frouter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265218750,"owners_count":23729528,"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":["algorithm","algorithms","constraints","eslint-prettier","jest","jsdoc","methods","rest-api","router","routes","tree","tree-structure","trie","trie-tree"],"created_at":"2024-11-09T12:29:32.678Z","updated_at":"2025-07-13T23:08:59.224Z","avatar_url":"https://github.com/PavelDeuce.png","language":"JavaScript","readme":"# router\n\n[![Node CI](https://github.com/PavelDeuce/router/actions/workflows/nodejs.yml/badge.svg)](https://github.com/PavelDeuce/router/actions/workflows/nodejs.yml)\n[![Actions Status](https://github.com/PavelDeuce/js-algorithms-trees-project-lvl1/workflows/hexlet-check/badge.svg)](https://github.com/PavelDeuce/js-algorithms-trees-project-lvl1/actions)\n[![Maintainability](https://api.codeclimate.com/v1/badges/cf29babbd64a5ec941bc/maintainability)](https://codeclimate.com/github/PavelDeuce/router/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/cf29babbd64a5ec941bc/test_coverage)](https://codeclimate.com/github/PavelDeuce/router/test_coverage)\n\n## About\n\nLightweight library to provide an API for handling routes\n\n## Example\n\n```javascript\nimport buildRouter from '@hexlet/code';\n\nconst routes = [\n  {\n    path: '/courses/:course_id/exercises/:id',\n    constraints: { id: /\\d+/, course_id: (courseId) =\u003e courseId.startsWith('js') },\n    handler: () =\u003e 'exercise!',\n  },\n];\n\nconst router = buildRouter(routes);\nconst result = router.serve({ path: '/courses/1/exercises/js' });\n// { handler: [Function handler] , path: '/courses/1/exercises/js', params: { id: '1', course_id: 'js' }, method: 'GET' }\nresult.handler(result.params); // exercise!\n\nrouter.serve('/courses/noop/exercises/noop'); // Error: No such path\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveldeuce%2Frouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaveldeuce%2Frouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveldeuce%2Frouter/lists"}