On Thu, Jan 20, 2011 at 6:37 PM, Benoit Chesneau <bchesn...@gmail.com> wrote: > On Thu, Jan 20, 2011 at 5:27 PM, Benjamin Young <benja...@couchone.com> wrote: >> On 1/20/11 10:45 AM, Benoit Chesneau wrote: >>> >>> On Thu, Jan 20, 2011 at 4:40 PM, Volker Mische<volker.mis...@gmail.com> >>> wrote: >>> >>>> { >>>> "from": "/page/:x/:y/:z", >>>> "to": "/_show/post/:x-:y-:z/something", >>>> "params": { >>>> "x": { >>>> "match": "\\d", >>>> }, >>>> "y": { >>>> "match": "\\d", >>>> }, >>>> "z": { >>>> "match": "\\d", >>>> } >>>> } >>>> >>> This one is already possible in current couchapp_legacy rewriter. I'm >>> not a fan to have something other than : >>> >>> patterns: { >>> "name1": "regexp", >>> ... >>> } >>> >>> It will make the system really complex. Maybe as an option though. I >>> can detect if I have an object or not. I think it would be better to >>> say ".*" >>> >>> >>> (and i need to find a new name for couchapp_legacy) >>> >>> >>> - benoīt >> >> I couldn't speak to the complexity of the code as I'm fairly new to Erlang. >> In any case, I think we need to keep the URL's in "from" and "to" easy to >> read and provide flexible parsing options with a "standard" (or standard >> set) available by default. >> >> If we support regular expressions, I'd suggest using PCRE over any other as >> its widely known and used (Django, nginx, PHP, mod_rewrite). >> > > Well did you read the README ? It's still using From, To. Reverse > dispatching is still here but improved. It also offer regexp, which > use re module in erlang based on PCRE. Readme is here: > > https://github.com/benoitc/couchapp_legacy > > It's using regexp ( or reverse url dispatching. About regexp it"s > using re module in erlang based on PCRE. > > Url template is a good idea. Are you speaking about: > > http://tools.ietf.org/html/draft-gregorio-uritemplate-04 ? > > It could be implemented using new engine. Also as a side node > couchapp_legacy is legacy as inheritance or tribute. It doesn't mean I > want it fully compatible with current one, users can still use old > rewrite handler. I will change its name during the night. > > - benoit >
Added query param handling as well : https://github.com/benoitc/couchapp_legacy/commit/1c9047375c394f9af6663462caa62588b254d1a6 I'm trying to include support for url templating right now.