The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi, Thank you. Have you seen https://metacpan.org/pod/Plack::Request#path_info/script_name? After re-reading the Plack::Request docs, I'm struggling to understand why did I pick such misleading names in the first place. What I'm talking about here has nothing to do with peeking at low level/raw stuff. So in neaf, the current convention is as follows:
This is arguably horrible and misleading. I would like to get rid of the middle part as it's superseded by the last one, and come up with sane names for (1) the part of path that matched current route and (2) the capture groups found in the remainder of the path. Other frameworks use param aliases for (2), except for sinatra (ruby) that calls it splat. The param approach doesn't play nicely with my "regexp filters everywhere" approach. get_post Could as well be put + patch. It's only delete that spoils everything and I have to maintain an any variant anyway. Does route return a route object? Something like Routes::Tiny::Match? I was thinking that route() should be a string, just the part of the path mathing current route. Apparently it's not the case with Dancer, so it's a misleading name after all. And I was also thinking about endpoint() method for providing the route details object, but it's not even in TODO yet. route_suffix Nice, although maybe a bit long. I think you're too close to your code, and I'm too far far far away :) This is why I have to ask. I need an outside view. In reply to Re^2: Better names for SCRIPT_NAME/PATH_INFO in a web framework?
by Dallaylaen
|
|