{"id":36419495,"url":"https://github.com/esase/tiny-router","last_synced_at":"2026-01-11T17:05:00.148Z","repository":{"id":38116301,"uuid":"283126477","full_name":"esase/tiny-router","owner":"esase","description":"Standalone routing implementation for HTTP and console requests","archived":false,"fork":false,"pushed_at":"2023-04-19T19:45:46.000Z","size":69,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-27T14:56:12.069Z","etag":null,"topics":["esase","framework","lightweight","microservices","mvc","routing","tinyframework"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/esase.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":"2020-07-28T06:50:27.000Z","updated_at":"2022-12-18T11:00:51.000Z","dependencies_parsed_at":"2022-08-21T11:50:47.448Z","dependency_job_id":null,"html_url":"https://github.com/esase/tiny-router","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/esase/tiny-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esase%2Ftiny-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esase%2Ftiny-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esase%2Ftiny-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esase%2Ftiny-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esase","download_url":"https://codeload.github.com/esase/tiny-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esase%2Ftiny-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: 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":["esase","framework","lightweight","microservices","mvc","routing","tinyframework"],"created_at":"2026-01-11T17:05:00.058Z","updated_at":"2026-01-11T17:05:00.141Z","avatar_url":"https://github.com/esase.png","language":"PHP","readme":"# tiny-router\n\n[![Build Status](https://travis-ci.com/esase/tiny-router.svg?branch=master)](https://travis-ci.com/github/esase/tiny-router/builds)\n[![Coverage Status](https://coveralls.io/repos/github/esase/tiny-router/badge.svg?branch=master)](https://coveralls.io/github/esase/tiny-router?branch=master)\n\n**Tiny/Routing** - it's a layer between the outside world like a browser or a console command [CLI](https://en.wikipedia.org/wiki/Command-line_interface)\nand your application. The package may be integrated to any existing `php` project and it does not require any\nextra packages. \n\n**Usually routing contains of two main parts:**\n1. `Routes` - which describe a meta information like - a `query`, a query `type`, and \na responsible `controller` which processes all incoming requests.\n\n2. A `Router` - just holds registered routes and matches incoming requests with registered routes.   \nSo it just returns either a matched route or trigger an `Exception` when a route is not found.\n\nCurrent implementation of routing is very simple but in the same time very powerful. It gets you \na possibility to work with it using a plain requests (`literal`) and [Regexp](https://en.wikipedia.org/wiki/Regular_expression) based requests, \nalso it supports filtering requests by http requests types like: `GET`,  `POST`, etc.  \nAlso you can use it as a routing for you `CLI` projects.\n\n**So let's check a look an http routing example:**\n\n```php\n\n    // create an instance of the router\n    $router = new Router(new RequestHttpParams($_SERVER));\n\n    // a literal `home` route\n    $router-\u003eregisterRoute(new Route(\n        '/',\n        'HomeController',\n        'index'\n    ));\n\n    // a literal `users` route which accepts only `GET` and `POST` requests\n    $router-\u003eregisterRoute(new Route(\n        '/users',\n        'UserController',\n        // list of actions\n        [ \n            'GET' =\u003e 'list',\n            'POST' =\u003e 'create'\n        ]\n    ));\n\n    // a more complex example using a `RegExp` rule\n    $router-\u003eregisterRoute(new Route(\n        '|^/users/(?P\u003cid\u003e\\d+)$|i', // it's matches to: `/users/1`, `/users/300`, etc\n        'UserController',\n        [\n            'GET' =\u003e 'view', \n            'DELETE' =\u003e 'delete',\n        ],\n        'regexp', \n        ['id']\n    ));\n\n    // now get a matched route \n    $matchedRoutes = $router-\u003egetMatchedRoute();\n```\n\n## Installation\n\nRun the following to install this library: \n\n```bash\n$ composer require esase/tiny-router\n```\n\n## Documentation\n\nhttps://tiny-docs.readthedocs.io/en/latest/tiny-router/docs/index.html\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesase%2Ftiny-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesase%2Ftiny-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesase%2Ftiny-router/lists"}