{"id":37265133,"url":"https://github.com/berxam/ranko","last_synced_at":"2026-01-16T00:05:30.162Z","repository":{"id":62493480,"uuid":"222859979","full_name":"berxam/ranko","owner":"berxam","description":"Minimal framework for creating RESTful APIs or simple web apps with PHP.","archived":false,"fork":false,"pushed_at":"2020-09-28T02:02:16.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-10T05:36:30.833Z","etag":null,"topics":["http","php","web"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/berxam.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}},"created_at":"2019-11-20T05:42:27.000Z","updated_at":"2020-09-28T01:56:09.000Z","dependencies_parsed_at":"2022-11-02T11:16:42.391Z","dependency_job_id":null,"html_url":"https://github.com/berxam/ranko","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/berxam/ranko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berxam%2Franko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berxam%2Franko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berxam%2Franko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berxam%2Franko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berxam","download_url":"https://codeload.github.com/berxam/ranko/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berxam%2Franko/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["http","php","web"],"created_at":"2026-01-16T00:05:29.491Z","updated_at":"2026-01-16T00:05:30.154Z","avatar_url":"https://github.com/berxam.png","language":"PHP","readme":"# ranko • micro framework for web apps\n\nMinimal framework for creating RESTful APIs or simple web apps with PHP.\n\n## Installation\n\nvia [Composer](https://getcomposer.org)\n```\ncomposer require berxam/ranko\n```\n\n## Features\n\nRanko is basically just a router to which you can mount routes with their corresponding callables, a `Request` and `Response` which get passed to each forementioned callable.\n- bind controller functions to HTTP methods and URLs or URL templates like `/users/:id`\n- access request body and headers easily through `Request`\n- respond to client with `Response` methods like `sendJSON(mixed $response)` and `render(string $view, mixed ...$params)`\n\n## Usage\n\nThe best way to understand how this \"framework\" works is to just skim through the files in this repo. This whole project is less than 500 lines.\n\n### Hello world\n\n`index.php`:\n```php\n\u003c?php\n    require_once './vendor/autoload.php';\n\n    $app = new Ranko\\App;\n\n    $app-\u003eget('/hello', function ($req, $res) {\n        $res-\u003esendJSON(['msg' =\u003e 'Hello world!']);\n    });\n\n    $app-\u003eget('/hello/:world', function ($req, $res) {\n        $world = $req-\u003eparams['world'];\n        $res-\u003esendHTML(\"\u003ch1\u003eHello, $world!\u003c/h1\u003e\");\n    });\n\n    $app-\u003erun();\n?\u003e\n```\n\nNote that you have to direct all requests to `index.php`. If you're running PHP on an Apache server, you can use this ```.htaccess``` rewrite:\n```apacheconf\nRewriteEngine on\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule . index.php [L]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberxam%2Franko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberxam%2Franko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberxam%2Franko/lists"}