Welcome the channel on the development of Cro, a set of libraries for building reactive distributed systems, lovingly crafted to take advantage of all the Raku Programming Language has to offer (cro.services). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
00:17 librasteve_ left 06:17 librasteve_ joined
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
10:02 librasteve_ left
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
15:45 librasteve_ joined
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"
18:05 librasteve_ left
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
18:43 librasteve_ joined
SmokeMachine 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
20:20 japhb left 20:24 japhb joined 20:40 jgaz joined