{"action":"created","issue":{"url":"https://api.github.com/repos/APItools/router.lua/issues/9","labels_url":"https://api.github.com/repos/APItools/router.lua/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/APItools/router.lua/issues/9/comments","events_url":"https://api.github.com/repos/APItools/router.lua/issues/9/events","html_url":"https://github.com/APItools/router.lua/pull/9","id":102264002,"number":9,"title":"Add support for Wildcard Routes","user":{"login":"NZKoz","id":197,"avatar_url":"https://avatars.githubusercontent.com/u/197?v=3","gravatar_id":"","url":"https://api.github.com/users/NZKoz","html_url":"https://github.com/NZKoz","followers_url":"https://api.github.com/users/NZKoz/followers","following_url":"https://api.github.com/users/NZKoz/following{/other_user}","gists_url":"https://api.github.com/users/NZKoz/gists{/gist_id}","starred_url":"https://api.github.com/users/NZKoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NZKoz/subscriptions","organizations_url":"https://api.github.com/users/NZKoz/orgs","repos_url":"https://api.github.com/users/NZKoz/repos","events_url":"https://api.github.com/users/NZKoz/events{/privacy}","received_events_url":"https://api.github.com/users/NZKoz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mikz","id":154571,"avatar_url":"https://avatars.githubusercontent.com/u/154571?v=3","gravatar_id":"","url":"https://api.github.com/users/mikz","html_url":"https://github.com/mikz","followers_url":"https://api.github.com/users/mikz/followers","following_url":"https://api.github.com/users/mikz/following{/other_user}","gists_url":"https://api.github.com/users/mikz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikz/subscriptions","organizations_url":"https://api.github.com/users/mikz/orgs","repos_url":"https://api.github.com/users/mikz/repos","events_url":"https://api.github.com/users/mikz/events{/privacy}","received_events_url":"https://api.github.com/users/mikz/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-08-21T00:00:44Z","updated_at":"2015-08-24T01:49:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/APItools/router.lua/pulls/9","html_url":"https://github.com/APItools/router.lua/pull/9","diff_url":"https://github.com/APItools/router.lua/pull/9.diff","patch_url":"https://github.com/APItools/router.lua/pull/9.patch"},"body":"Enables you to match an entire subtree to a single function rather than requiring multiple route definitions.  We have a number of services which 'own' everything in a sub tree an have quite a substantial list of routes internally.  By using a wildcard route we can just blindly send everything off to the relevant service, rather than having to have each sub-app's routes defined in both lua and the underlying app.\r\n\r\n```lua\r\nr:match('GET', '/api/news_feed/*everything', function(params)\r\n  -- proxy everything under /api/news_feed to the news_feed service\r\n  ngx.exec(\"@news_feed\")\r\nend)\r\n```"},"comment":{"url":"https://api.github.com/repos/APItools/router.lua/issues/comments/133985853","html_url":"https://github.com/APItools/router.lua/pull/9#issuecomment-133985853","issue_url":"https://api.github.com/repos/APItools/router.lua/issues/9","id":133985853,"user":{"login":"NZKoz","id":197,"avatar_url":"https://avatars.githubusercontent.com/u/197?v=3","gravatar_id":"","url":"https://api.github.com/users/NZKoz","html_url":"https://github.com/NZKoz","followers_url":"https://api.github.com/users/NZKoz/followers","following_url":"https://api.github.com/users/NZKoz/following{/other_user}","gists_url":"https://api.github.com/users/NZKoz/gists{/gist_id}","starred_url":"https://api.github.com/users/NZKoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NZKoz/subscriptions","organizations_url":"https://api.github.com/users/NZKoz/orgs","repos_url":"https://api.github.com/users/NZKoz/repos","events_url":"https://api.github.com/users/NZKoz/events{/privacy}","received_events_url":"https://api.github.com/users/NZKoz/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T01:49:25Z","updated_at":"2015-08-24T01:49:25Z","body":"We do have that problem, but it's pretty minor.  Most of our stuff falls through to a big monolith and it's just the high-load read endpoints (`GET`) that get routed in lua.\r\n\r\nThe only way to emulate rails' syntax would be to emulate our implementation, where you store routes as a linear list that's evaluated one at a time (modulo some smarts to skip ahead when there are known prefix-misses).  That'd make some of our cases easier for sure, but was a bigger change than I was prepared to hack up given the relatively minor cost of the dups to us."}}