SmokeMachine | I'm working on a utility (maybe a helper) to use with cro to make it possible to: by name (if the endpoint is a sub, or using the parameters to create the name) to refer to that endpoint, and have some methods on that (for now, it only has a path method). That way stuff like redirect may be much easier. What do you think? Does something like that make sense? usercontent.irccloud-cdn.com/file/.../image.png | 06:05 | |
I plan to add a `call` method that will run the block's endpoint and somehow add a `:endpoint` named parameter to `redirect` to receive the endpoint name and redirect to the right path. | 06:10 | ||
usercontent.irccloud-cdn.com/file/.../image.png | 06:17 | ||
this code with `redirect-to` is already working: usercontent.irccloud-cdn.com/file/.../image.png | 06:32 | ||
does something like this make sense? | 06:33 | ||
13:07
lizmat left,
lizmat joined
|
|||
SmokeMachine | github.com/FCO/Cro-HTTP-RouterUtil...ample.raku | 19:24 | |
librasteve | SmokeMachine: well - tbh I do not quite understand the use case for this ... and on first pass I was quite worried that this is overloading too much into the routes block (which is already quite an overloaded raku concept) -- otoh, usually you are more knowledgeable about the "right" place to put code to make something work right! so I would say, please do provide some idiot level examples and docs - and go ahead and make a PR | 19:53 | |
(in Cro::HTTP, I guess) and I would be happy to review... | |||
SmokeMachine | I'm not planing on adding that to Cro, but to create a new module that you can use instead of Cro::HTTP::Router that will give you option to refeer to the endpoints, so, instead of having to, for example, hardcode a path for redirecting, you can use a name and just do the redirection without needing to know the path... you can even include that with a prefix and it will find it out... | 20:06 | |
make sense? | 20:09 | ||
librasteve | Oh - OK ... I just figured that Cro::HTTP::RouterUtils would be released as part of Cro::HTTP from the Cro org on GH ... I would be happy with that (maybe you need credentials) or with what you have in mind | 20:13 | |
on the content - I am the kind of guy that would need to play with the code to grok what it is doing | 20:14 | ||
20:15
librasteve_ joined
|
|||
SmokeMachine | weekly dev.to/fco/typed-named-endpoints-f...elpers-g9j | 22:15 | |
weekly: dev.to/fco/typed-named-endpoints-f...elpers-g9j | |||
23:37
librasteve_ left
|