9 Aug 2025 | |||
wayland | Looks like no-one has touched it in 7 months, and CI is failing. | 10:48 | |
Oh, and the CI is also using version 2022.02 | 10:49 | ||
The really odd thing is that that command worked the other day. | |||
16 Aug 2025 | |||
Geth | cro-webapp/main: 44aa84db2b | librasteve++ | resources/prelude.crotmp add required attr to input tags |
16:56 | |
cro-webapp/main: a31df2e84e | librasteve++ | Changes add required attr to input tags |
|||
cro-webapp/main: a90116cfb8 | librasteve++ (committed using GitHub Web editor) | 2 files Merge pull request #100 from librasteve/main Add required attr to input tags |
|||
18 Aug 2025 | |||
disbot | <simon_sibl> Hi, for Cro is it possible to create a “default” route for any accepted methods ? | 06:30 | |
lizmat | simon_sibl ask yourself: what would the signature of a sub be to be accepting *any* arguments? | 07:30 | |
disbot | <simon_sibl> I’ll try “any” but it’s not in the doc I think xD | 09:41 | |
lizmat | hehe | 09:43 | |
m: sub a(|) { dd }; a(); a(42); a("foo") | |||
sub a(|) sub a(|) sub a(|) |
09:44 | ||
the pipe without any characters, is an anonymous capture | 09:45 | ||
docs.raku.org/language/signatures#...parameters | |||
disbot | <simon_sibl> yeah the any doesnt seem to work | 10:50 | |
lizmat | Any can be useful to accept a single positional argument | 10:51 | |
disbot | <simon_sibl> any -> *@path { content 'text/html', "Its working but probably not the page you want";} I tried this but just got a 404 | ||
<simon_sibl> I meant for the http methods | |||
<simon_sibl> instead of post, get ..., have a route for all methods with same path | |||
lizmat | perhaps * -> *@path | 10:52 | |
where the left * would be a Whatever | |||
disbot | <simon_sibl> compile error for that... | ||
lizmat | maybe librasteve or patrickb could be of help: it's been a while since I worked with Cro :-) | 10:53 | |
disbot | <librasteve> aiui, get -> 'greet', $name { content 'text/plain', "Hello, $name!"; } is a raku subroutine call get() which accepts a Callable argument. In this case, the callable '-> greet', $name { content 'text/plain', "Hello, $name!"; } specifies a block with a signature attached. | 15:49 | |
<librasteve> TLDR; "no" | |||
SmokeMachine | simon_sobl: I haven’t tried that, but have you tested something like `http <GET POST PUT DELETE>.any, -> {…}`? I’m not sure if it would work… but I think `http` function should also accept a list and/or a whateverstar… | 18:37 | |
github.com/croservices/cro-http/bl...umod#L1287 | 18:38 | ||
is it expected to cro's xt tests fail with certificate expired error? What am I doing wrong? | 19:09 | ||
Geth | cro-http: FCO++ created pull request #205: feat: Make http function accept a list of http methods |
19:17 | |
SmokeMachine | does something like this ☝️ make sense? | 19:18 | |
I had problems testing because of expirated certificates... but besides that, it seems the tests I added are passing... | 19:19 | ||
disbot | <librasteve> SmokeMachine: you are a genius … I’ll try to review/merge the PR properly tomorrow … please can you add a comment with the test error / what certs are missing? | 20:05 | |
19 Aug 2025 | |||
<simon_sibl> this seems to work !! thanks ! | 02:06 | ||
7 Sep 2025 | |||
<jubilatious1_98524> test | 19:50 | ||
21 Sep 2025 | |||
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 | ||
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 | ||
SmokeMachine | weekly dev.to/fco/typed-named-endpoints-f...elpers-g9j | 22:15 | |
weekly: dev.to/fco/typed-named-endpoints-f...elpers-g9j |