{"id":20511524,"url":"https://github.com/thiiagoms/trouter","last_synced_at":"2026-07-02T14:32:08.224Z","repository":{"id":115850479,"uuid":"590843655","full_name":"thiiagoms/trouter","owner":"thiiagoms","description":":elephant: :arrows_counterclockwise: TRouter is a lightweight and flexible PHP router library designed for building web applications and APIs","archived":false,"fork":false,"pushed_at":"2024-06-08T13:39:07.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T04:46:26.203Z","etag":null,"topics":["php","php-router","php-routing","router"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiiagoms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-01-19T10:49:45.000Z","updated_at":"2023-05-23T02:47:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a40625b-9527-48f1-97c1-dba04f236f20","html_url":"https://github.com/thiiagoms/trouter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thiiagoms/trouter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiiagoms%2Ftrouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiiagoms%2Ftrouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiiagoms%2Ftrouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiiagoms%2Ftrouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiiagoms","download_url":"https://codeload.github.com/thiiagoms/trouter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiiagoms%2Ftrouter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35051638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["php","php-router","php-routing","router"],"created_at":"2024-11-15T20:36:14.813Z","updated_at":"2026-07-02T14:32:08.205Z","avatar_url":"https://github.com/thiiagoms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/thiiagoms/trouter\"\u003e\n        \u003cimg src=\"assets/router.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n    \u003c/a\u003e\n    \u003ch3 align=\"center\"\u003eVanilla PHP Router :mage:\u003c/h3\u003e\n    \u003cp float=\"left\"\u003e\n        \u003cimg\n            src=\"https://img.shields.io/badge/PHP-777BB4?style=for-the-badge\u0026logo=php\u0026logoColor=white\"\n            alt=\"PHP\"\n        \u003e\n        \u003cimg\n            src=\"https://img.shields.io/badge/Shell_Script-121011?style=for-the-badge\u0026logo=gnu-bash\u0026logoColor=white\"\n            alt=\"Shell Script\"\n        \u003e\n        \u003cimg\n            src=\"https://img.shields.io/badge/Docker-2496ED?style=for-the-badge\u0026logo=docker\u0026logoColor=white\"\n            alt=\"Docker\"\n        \u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\nTRouter is a lightweight and flexible routing library for PHP. It allows you to easily define and manage your application's routes in a clear and concise way, without requiring any external dependencies or complicated configuration.\n\nWith TRouter, you can quickly and easily define routes using a simple and intuitive syntax. You can specify the HTTP method, the path pattern, and a callback function that should be executed when the route is matched. You can also define optional parameters and regular expression constraints for your routes,\nmaking it easy to handle dynamic and complex URLs\n\n### Dependencies :memo:\n- Docker or Composer (PHP8.1+)\n\n### Install :package:\n\n#### Composer\n```bash\n$ composer require thiiagoms/trouter\n```\n#### Docker\n\n01 - Clone the repository:\n```bash\n$ git clone https://github.com/thiiagoms/trouter\n```\n\n02 - Switch to `trouter` directory:\n```bash\n$ cd trouter\ntrouter $\n```\n\n03 - Run `setup.sh`:\n```bash\ntrouter $ chmod +x ./setup.sh\ntrouter $ ./setup.sh\n\n████████╗██████╗  ██████╗ ██╗   ██╗████████╗███████╗██████╗ \n╚══██╔══╝██╔══██╗██╔═══██╗██║   ██║╚══██╔══╝██╔════╝██╔══██╗\n   ██║   ██████╔╝██║   ██║██║   ██║   ██║   █████╗  ██████╔╝\n   ██║   ██╔══██╗██║   ██║██║   ██║   ██║   ██╔══╝  ██╔══██╗\n   ██║   ██║  ██║╚██████╔╝╚██████╔╝   ██║   ███████╗██║  ██║\n   ╚═╝   ╚═╝  ╚═╝ ╚═════╝  ╚═════╝    ╚═╝   ╚══════╝╚═╝  ╚═╝\n\n  [*] Author: Thiago Silva AKA thiiagoms\n  [*] E-mail: thiagom.devsec@gmail.com\n```\n\n04 - Go to `http://localhost:8000`\n\n### Usage :gear:\n\nHere's a basic example of how to use TRouter to define and handle routes in your PHP application:\n```php\n\u003c?php\n\nrequire_once 'vendor/autoload.php';\n\nuse Trouter\\Router;\n\n$router = new Router();\n\n$router-\u003eget('/', function () {\n    echo 'Hello, world!';\n});\n\n$router-\u003eget('/posts', function () {\n    echo 'List of posts';\n});\n\n$router-\u003eget('/posts/:id', function ($id) {\n    echo \"Showing post #$id\";\n});\n\n$router-\u003epost('/posts', function () {\n    echo 'Creating a new post';\n});\n\n$router-\u003eput('/posts/:id', function ($id) {\n    echo \"Updating post #$id\";\n});\n\n$router-\u003edelete('/posts/:id', function ($id) {\n    echo \"Deleting post #$id\";\n});\n\n$router-\u003erun();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiiagoms%2Ftrouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiiagoms%2Ftrouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiiagoms%2Ftrouter/lists"}