{"id":23817815,"url":"https://github.com/lsongdev/routing2","last_synced_at":"2025-02-21T21:57:20.313Z","repository":{"id":68774081,"uuid":"99646035","full_name":"lsongdev/routing2","owner":"lsongdev","description":":triangular_flag_on_post: Parse HTTP Routing definition with no dependencies, just ~3kb!","archived":false,"fork":false,"pushed_at":"2019-07-10T02:14:29.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T22:23:47.986Z","etag":null,"topics":["http","http-routing","router","routing"],"latest_commit_sha":null,"homepage":"https://npmjs.org/routing2","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lsongdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"song940","patreon":"song940","open_collective":"song940","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://git.io/fjRcB"}},"created_at":"2017-08-08T03:29:54.000Z","updated_at":"2019-11-05T02:28:53.000Z","dependencies_parsed_at":"2023-04-19T09:17:54.405Z","dependency_job_id":null,"html_url":"https://github.com/lsongdev/routing2","commit_stats":null,"previous_names":["lsongdev/routing2","song940/routing2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Frouting2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Frouting2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Frouting2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Frouting2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsongdev","download_url":"https://codeload.github.com/lsongdev/routing2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240093155,"owners_count":19746780,"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":["http","http-routing","router","routing"],"created_at":"2025-01-02T05:48:48.903Z","updated_at":"2025-02-21T21:57:20.275Z","avatar_url":"https://github.com/lsongdev.png","language":"JavaScript","readme":"## routing2\n\n\u003e Parse HTTP Routing definition with no dependencies, just ~3kb!\n\n[![routing2](https://img.shields.io/npm/v/routing2.svg)](https://npmjs.org/routing2)\n[![Build Status](https://travis-ci.org/song940/routing2.svg?branch=master)](https://travis-ci.org/song940/routing2)\n\n### Define\n\n\u003cimg src=\"./define.png\" width=\"50%\" \u003e\n\n### Installation\n\n```bash\n$ npm install routing2\n```\n\n### Example\n\n```js\nconst routing = require('routing2');\n\nconst routes = routing.parse(`\nget / =\u003e home#index\nget /:name =\u003e user#index, { \"foo\": \"bar\" }\npost /user =\u003e user#create\n`);\n\nconst request = {\n  method: 'get',\n  url: '/lsong?foo=bar'\n};\n\nconst route = routing.find(routes, request);\n\nconsole.log(route);\n// { status: 200,\n//   route:\n//    { domain: undefined,\n//      path: '/:name',\n//      action: 'index',\n//      controller: 'user',\n//      options: { foo: \"bar\" },\n//      method: 'GET' },\n//   params: { name: 'lsong' },\n//   query: { foo: 'bar' } }\n```\n\n### Contributing\n- Fork this Repo first\n- Clone your Repo\n- Install dependencies by `$ npm install`\n- Checkout a feature branch\n- Feel free to add your features\n- Make sure your features are fully tested\n- Publish your local branch, Open a pull request\n- Enjoy hacking \u003c3\n\n### MIT\n\nThis work is licensed under the [MIT license](./LICENSE).\n\n---","funding_links":["https://github.com/sponsors/song940","https://patreon.com/song940","https://opencollective.com/song940","https://git.io/fjRcB"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Frouting2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsongdev%2Frouting2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Frouting2/lists"}