{"id":19206879,"url":"https://github.com/pkoretic/recurse-router","last_synced_at":"2026-06-16T03:32:21.038Z","repository":{"id":35369156,"uuid":"39632110","full_name":"pkoretic/recurse-router","owner":"pkoretic","description":"A routing middleware for the recurse web framework","archived":false,"fork":false,"pushed_at":"2016-08-24T14:38:13.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-26T01:09:36.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/pkoretic.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":"2015-07-24T12:35:27.000Z","updated_at":"2018-05-20T14:55:12.000Z","dependencies_parsed_at":"2022-09-09T07:01:59.478Z","dependency_job_id":null,"html_url":"https://github.com/pkoretic/recurse-router","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pkoretic/recurse-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Frecurse-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Frecurse-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Frecurse-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Frecurse-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkoretic","download_url":"https://codeload.github.com/pkoretic/recurse-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Frecurse-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34390052,"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-06-16T02:00:06.860Z","response_time":126,"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":[],"created_at":"2024-11-09T13:17:17.436Z","updated_at":"2026-06-16T03:32:21.024Z","avatar_url":"https://github.com/pkoretic.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Router\n\n[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/xwalk/recurse-router/blob/master/LICENSE)\n\nRecurse router middleware\n\nSupports:\n\n * GET\n * PUT\n * POST\n * PATCH\n * DELETE\n * HEAD\n * OPTIONS\n * ALL - matches all routes\n\n\n### Example\n\n```\n#include \"router.hpp\"\n\nint main(int argc, char *argv[])\n{\n    Recurse app(argc, argv);\n\n    Module::Router router;\n\n    router.GET(\"/hello/:user\", [](auto \u0026ctx, auto /* next */)\n    {\n        ctx.response.send(\"Hello World \" + ctx.request.getParam(\"user\"));\n    });\n\n\tapp.listen();\n}\n```\n\n### Parameters\n\n\nParameters are saved in QHash `params` property inside **Recurse** `Request` class.\nTo fetch values use `Request::getParam(key)` helper function:\n\n```\nctx.request.getParam(\"name\")\n```\n\nStandard, required params:\n\n```\n#include \"router.hpp\"\n\nint main(int argc, char *argv[])\n{\n    Recurse app(argc, argv);\n\n    Module::Router router;\n\n    // matches /hello/john\n    router.GET(\"/hello/:name\", [](auto \u0026ctx, auto /* next */)\n    {\n        ctx.response.send(\"hello world \" + ctx.request.getParam(\"name\");\n    });\n\n\tapp.listen();\n}\n\n```\n\nOptional params\n\n```\n\n    // matches both /hi and /hi/johnny requests\n    router.GET(\"/hi/:user?\", [](auto \u0026ctx, auto /* next */)\n    {\n        ctx.response.send(\"hi \" + ctx.request.getParam(\"name\");\n    });\n```\n\nUniversal, catch-all parameter\n\n```\n    // matches all GET calls (those that are not catched before hand)\n    router.GET(\"*\", [](auto \u0026ctx, auto /* next */)\n    {\n        ctx.response.send(\"hi all\");\n    });\n\n```\n\ncatch-all with Router.ALL, matches everything\n```\n    // matches all calls (those that are not catched before hand)\n    router.ALL(\"*\", [](auto \u0026ctx, auto /* next */)\n    {\n        ctx.response.send(\"all matched, all catched\");\n    });\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkoretic%2Frecurse-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkoretic%2Frecurse-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkoretic%2Frecurse-router/lists"}