The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2016-11-22

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:05 jontaylor joined #mojo
00:46 gizmomathboy joined #mojo
01:00 jontaylor joined #mojo
01:10 aborazmeh joined #mojo
01:36 Paddi joined #mojo
02:13 kaare joined #mojo
02:57 lluad joined #mojo
03:32 noganex_ joined #mojo
03:49 Paddi joined #mojo
03:50 Paddi Hi all. For Mojo::UserAgent, is that possible to tell $ua not to escape the $json when I do a $ua->patch( $url => { $headers } => json => $json) ?
03:50 Paddi due to the added "\\", remote server trigger error message :(
04:04 jberger Paddi that is valid json
04:05 jberger if you really need a more flexible JSON emitter, use Cpanel::JSON::XS and render the results using the data stash key
04:12 mishanti1 joined #mojo
04:26 lloy0076 joined #mojo
04:28 lloy0076 left #mojo
04:51 Paddi @jberger: thanks for the advise, I use parse_json (JSON::Parse) to convert to string... previously the remote server reject even I send a valid json, they don't like \\
04:53 jberger JSON::Parse doesn't emit JSON, only consumes
04:53 jberger it
04:53 jberger I'm very confused
04:56 Grinnz JSON::Parse would convert a string to a data structure, json => $foo takes a data structure and sends it as a string
04:56 Grinnz also, use Mojo::JSON or JSON::MaybeXS, nobody knows how JSON::Parse works
05:03 Paddi @Grinnz: okay will switch to those module, I use parse_json because remote server only expect '{ key1 => "val1", key2 => "val2" ... keyN => "valN" }'. If I send a proper json over via $ua->patch ... remote server will receive '{ key1 => \"val1\" ...}' and they will reject it
05:04 Grinnz that sounds like you are not passing the value correctly
05:04 jberger Paddi: the remote shouldn't get => separated keys, that's perl structure not JSON
05:04 Grinnz that's not valid JSON
05:04 Grinnz i mean, it's just a string in JSON
05:04 Grinnz not a JSON tructure
05:04 Grinnz structure
05:04 purl i guess structure is similiar too. or correct
05:04 dboehmer_ joined #mojo
05:05 Grinnz if you show more code we can help figure out where the data is being sent incorrectly
05:07 jberger that was weird
05:14 Grinnz i'm really curious how he ended up with a string of a perl hash declaration
05:18 jberger I'm assuming they didn't understand how JSON worked and thus were trying to Dumper a perl structure
05:18 jberger then probably reencoding as JSON
05:19 jberger which would account for the fear or escaped slashes
05:19 jberger s/or/of/
06:17 inokenty-w joined #mojo
06:21 Paddi joined #mojo
06:25 dod joined #mojo
06:58 dod joined #mojo
06:59 batman jberger / preaction: i don't follow. What could be useful..?
07:00 polettix joined #mojo
07:00 preaction i could make cpantesters transmit cpan upload notifications via websockets
07:01 preaction cpantesters scans for new uploads every 5 minutes
07:02 dod joined #mojo
07:06 mbudde joined #mojo
07:10 batman Ah! Cool :)
07:10 batman I'm so sleepy :(
07:16 Vandal15263 joined #mojo
07:58 rshadow joined #mojo
08:03 AndrewIsh joined #mojo
09:19 osfabibisi joined #mojo
09:20 rshadow joined #mojo
09:22 trone joined #mojo
09:33 bc547_ joined #mojo
09:45 gregf_ joined #mojo
10:25 salva joined #mojo
10:44 sri btw. the ikea signum is really good
10:44 sri got two yesterday for my desk
10:48 * coolo can recommend kakor havreflarn - if you ask my daugther this is ikea's main product :)
10:53 sri lol
10:55 sri they do sell a lot of food these days
10:57 jontaylor joined #mojo
10:59 coolo sri: https://de.statista.com/statistik/daten/studie/267934/umfrage/umsatzstaerkste-unternehmen-der-systemgastronomie-in-deutschland/ - rank #9
11:12 ssm joined #mojo
11:16 tchaves joined #mojo
11:20 rshadow joined #mojo
11:59 c0xc joined #mojo
12:16 gregf_ joined #mojo
12:17 sri coolo: the data is hidden behind a paywall, but i believe it, even at 18:30 in the evening the ikea restaurant was packed
12:33 asarch joined #mojo
12:44 alexbyk joined #mojo
12:50 marty joined #mojo
13:20 mib_nbpetp joined #mojo
13:21 mib_nbpetp hello
13:21 mib_nbpetp this doesn't do what I expect it to: it prints the time once, and exits: http://paste.scsys.co.uk/539850
13:22 mib_nbpetp what am I missing?
13:31 nic mib_nbpetp: best start with a working example from the docs
13:31 nic you'll then hit the ahh moment (and learn more)
13:32 mib_nbpetp I did start with that
13:32 nic so rewind to the previous step where it was working as expected and look at the breaking change
13:35 mib_nbpetp http://paste.scsys.co.uk/539851
13:36 mib_nbpetp refined question in the comment, can someone advise?
13:38 mib_nbpetp nic?
13:38 purl nic is network interface card or network information centre
13:39 gizmomathboy joined #mojo
13:44 mib_nbpetp no takers? :(
13:53 jberger mib_nbpetp needing to begin some work is a documented behavior of delays
13:53 Paddi joined #mojo
13:53 jberger this allows short-circuiting of a chain of steps
13:58 mishanti1 Are there any fiddly-bits I kan twist or nudge in mojo to have it be very verbose on what it is doing? Having a very annoying issue where one mojo-app on this box is just not logging _anything_.
13:58 jberger hmmmm, I thought there was a more explicit statement than this: http://mojolicious.org/perldoc/Mojo/IOLoop/Delay#steps "This chain will continue until there are no "remaining" callbacks, **a callback does not increment the event counter** or an exception gets thrown in a callback."
13:59 jberger but anyway, there it is
13:59 jberger sri: would you mind strengthening that statement slightly?
13:59 jberger "This chain will continue until there are no "remaining" callbacks, a callback does not increment the event counter (ie, C</begin> is not called) or an exception gets thrown in a callback."
14:00 sri jberger: meh
14:00 jberger errr, s/C/L/
14:02 jberger mishanti1 set MOJO_DAEMON_DEBUG=1
14:02 jberger assuming the problem is in the application/server
14:03 jberger if you are expecting logging and not getting any, it might be that your log level is too high, try setting MOJO_LOG_LEVEL=debug
14:04 jberger also possibly relevant are MOJO_USERAGENT_DEBUG=1 and MOJO_WEBSOCKET_DEBUG=1
14:05 mib_nbpetp jberger: I am not sure I understand...
14:05 mib_nbpetp what is "remaining callbacks" in this context?
14:05 mishanti1 jberger: Thanks. Had debug loglevel set previously, got no real output. Now alsp set MOJO_DAEMON_DEBUG=1, got some more debug but nothing after it had printed the details of the request coming in.
14:06 jberger mishanti1: what output are you expecting/needing?
14:06 dod joined #mojo
14:06 mishanti1 Weird thing is that other people here have checked out the exact same version of the code, and experience no issues. Guess I'll find my good old friend strace and see if there is anything fishy going on.
14:06 jberger mib_nbpetp: remaining callbacks == steps
14:06 mishanti1 jberger: Just needing to see what it is doing. Or rather, why it isn't doing anything-
14:07 jberger mishanti1: I get that, but you are being rather vague about what it is you need, so I don't know how to help you
14:07 mishanti1 Oh, and it is not responding to any signals. Need to kill -9 to stop morbo.
14:08 mib_nbpetp jberger: but there *is* an extra step in that paste...
14:08 mib_nbpetp I suspect my terminology is off :/
14:08 jberger right, but it doesn't matter if you don't call begin (ie, increment the counter)
14:08 mishanti1 jberger: Yeah, I know. Sorry about being vague. I just have no idea where to start debugging this. What it looks like is that both morbo and hypnotoad just hangs there, doing nothing, not even reacting to SIG*.
14:09 jberger mib_nbpetp: see the snippet I posted containing the **text**
14:09 mishanti1 I'll fiddle some more and see if I can at least provoke it to crash.
14:10 jberger mishanti1 try doing a direct request to the application script
14:10 mib_nbpetp jberger: hmmm... so like *any* code in a step must be wrapped in a begin/end essentially?
14:10 jberger ./myapp.pl get /
14:10 jberger mib_nbpetp: without begin ever being called, there is nothing to add to the event loop
14:11 jberger if you are in a weird case where a step is "optional" you might need to have a dummy to indicate you want to continue, you can use ->pass for that
14:12 jberger but that's a pretty rare case and if you are doing that too often you are probably Doing It Wrong (TM)
14:12 gregf_ joined #mojo
14:12 jberger :-P
14:13 ramortegui joined #mojo
14:13 gryphon joined #mojo
14:14 jberger mib_nbpetp: for example, I have in my work code (and thus I can't show you) a chain of steps like this
14:14 jberger check if resource is locked, check if lock is alive or stale (and if stale cleanup), access resouce
14:15 jberger the middle step is optional, since if the first step returns that the resource isn't locked then I don't need to check if the lock is active
14:16 jberger now the lock being active would return a boolean to the final step, so if the middle step is unnessesary I run something like return $delay->pass(0) unless $locked
14:16 mib_nbpetp hm hm hm... ok let's step back for a bit because maybe looking at ::Delay is wrong
14:16 jberger that skips the middle step and moves on to the last one with an indication that there is no active lock
14:17 mishanti1 Huh. Huh. Huh.
14:18 * mishanti1 hugs `strace`
14:18 rshadow1 joined #mojo
14:18 mib_nbpetp https://metacpan.org/pod/Mojo::SlackRTM <--- I intend to keep a loop running that talks to slack via this thing, *EXCEPT* it needs dynamic configuration on connect, that it obtains from slack itself ( via he 'hello' callback ) and then in parallel from another web api which needs to be asked several question in sequence
14:19 mib_nbpetp jberger: I am struggling how to organize my codeflow so that all the Slack callbacks "wait" until the initial configuration is "put together" by two chains running somewhat in "parallel"
14:19 jberger mib_nbpetp: I suspect you want more event-based flow
14:19 mib_nbpetp link to start reading from?
14:20 jberger this isn't mojo-specific, I don't think we have documentation on non-blocking patterns
14:20 jberger but you'd want a function for what to do on connect and another for listening to routing traffic
14:20 mishanti1 So apparently, if you have an invalid entry (nameserver ...) in your resolv.conf things go boo-boo. I am not yet sure which of the modules we use that provokes this issue. Need to dig further.
14:21 jberger and your connect callback would trigger the listen callback once you are up and running
14:21 jberger mishanti1 interesting
14:21 mib_nbpetp yes I get how to do that ( the end of the "config" will add new on-event callbacks to the slack client )
14:22 mishanti1 Net::DNS::Resolver seems to be the offender, cleverly deciding just to indefinitly retry the same server even though it gets socket-rejection.
14:22 mib_nbpetp what I am not sure about is how to organize the "start config / ask these 2 services via... stuff / then process what you have missed on slack / then add the realtime callbacks"
14:22 mib_nbpetp jberger: ^^ is this a case for ::Delay->steps or not?
14:23 jberger sure, the sequential calls can be
14:23 jberger although, if truly nothing else should happen while it is starting it, you might as well just use blocking calls to do it
14:24 mib_nbpetp but I want the 2 "branches" of the config to happen simultaneously
14:24 jberger then delays are definitely what you want
14:24 jberger but you want two begins in the same step
14:33 jberger mib_nbpetp: here's some quick pseudocode: https://gist.github.com/jberger/9c9b7c2f3f99f2a20b534985362450f2
14:34 mib_nbpetp a-ha!
14:35 mib_nbpetp jberger: I am on the right track then, thanks
14:35 jberger cheers
14:37 marty_ joined #mojo
14:37 rshadow joined #mojo
15:02 nic left #mojo
15:15 abra joined #mojo
15:24 spicyjack if I generate a lite app, then add the daemon/-l/http://*:<port> arguments to app->start() at the bottom of the file, then none of the Mojolicious commands work for that lite app, in particular 'routes', instead, the app just starts listening for requests
15:24 spicyjack The app->start() call looks like the one at the bottom of https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#Commands
15:25 spicyjack does this sound normal?
15:25 spicyjack Perl 5.24.0, Mac OS X Yosemite, fresh Mojo 7.10 Donut
15:28 stryx` joined #mojo
15:31 lluad joined #mojo
15:33 abra joined #mojo
15:33 jberger spicyjack that isn't the recommended way to start an application
15:34 jberger I mean, you CAN, but that is effectively passing in command line arguments
15:35 jberger calling ->start with arguments is basically obviating the rest of the commands system, since you are always passing in those arguments
15:36 spicyjack ahh, makes sense now, thanks
15:38 PryMar56 joined #mojo
15:46 disputin joined #mojo
15:47 [vlad] how do i get the request stuff in mojo? particularly the request uri with the query parameters?
15:47 [vlad] sorry if its an rtfm question
15:47 * sri is starting to understand why nobody really likes the rpm packages
15:49 plicease joined #mojo
15:50 Paddi @[vlad]: $self->req->param("name") ?
15:50 [vlad] ah cool
15:50 [vlad] thanks
15:50 [vlad] can i get a hashref of the lot?
15:51 [vlad] nm let me try
15:51 Paddi lot? do you means grab every req param as a hash? $self->req->params()->to_hash; or smth like that ... need to refer to Mojo::Parameters
15:52 [vlad] thanks again
15:53 [vlad] i think i might be doing a lot of thanking over the next couple of days
16:03 polettix joined #mojo
16:34 Pyritic joined #mojo
16:42 rshadow joined #mojo
16:48 dantti_laptop joined #mojo
17:01 dod joined #mojo
17:05 dantti_laptop coolo: lol so you don't like Cutelyst because I stopped maintaining Apper? :) was digging on reffering stuff now that I get a bit more visits and happend to found an irc log :P
17:07 dantti_laptop I still have plans to Apper once Qt QML compiler gets open source should be in 5.9 (if they don't postpone again)
17:10 Pyritic joined #mojo
17:20 rshadow joined #mojo
17:22 sri coolo: busted!
17:24 sri dantti_laptop: o/
17:25 dantti_laptop :)
17:27 stryx` joined #mojo
17:33 sri funny thing that happened last month when i was at suse hq, the guy sitting across from my temporary desk there asked me "you do perl right, do you know catalyst? someone ported that to qt!", he's a qt guy :D
17:34 pink_mist lol, awesome :P
17:35 dantti_laptop sri: hehe nice, people often say the right tool for the job, but as much as I find Perl a nice language knowing it well and knowing Qt/C++ well is a very hard task, I for instance don't understand a line of C++ templatin stuff :P so imagine trying to debug my perl web apps
17:35 Jonis joined #mojo
17:45 mishanti1 Qt/C++ was _very_ comfortable to work with, back in the day when I did that.
17:45 mishanti1 Great tooling, very DWIM.
17:48 mishanti1 Not to mention Trolltechs technical support that you got by obtaining licenses. That was _fantastic_. Truly outstanding.
17:53 rshadow joined #mojo
18:10 suede joined #mojo
18:20 rshadow joined #mojo
18:44 jberger sri: hahaha
18:55 coolo dantti_laptop: there are always 2 sides of a medal :)
18:55 coolo dantti_laptop: but as I said on G+, good job
18:55 [vlad] Turn parameters into a hash reference. Note that this method will normalize the parameters.
18:55 [vlad] does that just mean i will lose charset and stuff like that?
18:56 [vlad] in Mojo::Parameters
18:57 dantti_laptop coolo: hmm I don't have you there, thanks, hopefully soon I'll find time to revive Apper (now that Cutelyst is mostlys "done") :)
18:57 [vlad] normalize == not an object any more?
18:57 [vlad] hm i guess
18:58 pink_mist [vlad]: no, I'd expect you can find the term defined in the HTML spec or something
18:59 pink_mist probably this: https://www.w3.org/TR/xml/#AVNormalize
18:59 dantti_laptop lol I do have you, I didn't map your name to your nick :P
18:59 [vlad] thanks
19:01 pink_mist or possibly https://tools.ietf.org/html/rfc3986#page-38
19:01 [vlad] yeah its cool it just remove empty nodes
19:21 rshadow joined #mojo
19:41 jabberwok Should the docs for Mojolicious::Command::test note that the tests are run in ASCIIbetical order, as dictated by Mojo::Util::files (and also a note on the sorting in docs there) ...?
19:42 sri no
19:45 jabberwok so... if i have a few dozen test modules to run, all of which require a loaded database, it would be wrong to make, say, t/00.t the test that populates the database? How do we deal with tests that must be run in order?
19:45 jabberwok or should I write a few thousand tests all in one file  O.o
19:45 disputin joined #mojo
19:46 preaction requiring tests be run in order isn't a good idea, for this reason. make a module in t/lib/ with some fixtures that deploy a schema
19:46 sri i keep them all isolated
19:47 sri https://github.com/kraih/mojo-pg/blob/master/t/migrations.t#L13-L17
19:48 sri to put it bluntly, i think requiring tests to run sequential is stupid
19:48 jabberwok "fixture" ?
19:48 sri you've got shitloads of cpu cores these days, run your tests parallel
19:49 preaction "fixtures" are sets of data. you load in the data to the database and then run your test
19:51 sri with sqlite you use a different temp file per test, with postgresql a different schema
19:51 jabberwok but a test that checks number of users, adds a user, then re-checks number of users, will fail if you are running other tests sequentially... ?  and if i have a test that blitzes the db and reloads before each test, that can't run sequentially either. -- i'm using Mojo::Pg
19:51 preaction (or with postgres, even a different running database process)
19:52 sri jabberwok: schemas
19:52 jabberwok is a schema something different from a database?
19:52 preaction it's a level higher than database
19:53 sri you can put the same tables in two schemas to isolate them from each other
19:53 preaction so just like a database is a set of tables, a schema is a set of databases
19:54 Grinnz other way around
19:54 purl i think other way around is not better
19:54 sri database is a set of schemas, schema is a set of tables
19:54 Grinnz database is a set of schemas
19:54 jabberwok ummm... ok.  i have always used psql command line to create a test database. that has to run as privileged. i'm not sure how you would do that from inside a test?
19:54 Grinnz https://metacpan.org/pod/DBIx::TempDB is another option
19:55 Grinnz yes, the role you connect with would have to have permission to create the database
19:55 preaction https://metacpan.org/pod/Test::PostgreSQL
19:55 Grinnz (or schema)
19:55 jabberwok Ah very nice Grinnz
19:55 preaction Test::PostgreSQL doesn't require permissions, because it builds its own database process
19:57 jabberwok thanks, all.  these are the pointers i was looking for.
19:57 sri i reuse the same database every time, and pass which one to use to my tests with an env var
19:58 sri that test database i've created manually and keep aroudn for everything Mojo::Pg
19:59 sri https://github.com/kraih/minion/blob/master/t/pg_lite_app.t#L17-L23
20:00 sri https://github.com/kraih/minion/blob/master/t/pg.t#L14-L20
20:00 sri https://github.com/kraih/minion/blob/master/t/pg.t#L7
20:01 sri fast testing is part of my process, so i make sure everything can run with "prove -j9" and will finish in seconds
20:03 sri i mean, you have to prepare the database with credentials anyway, might as well make a test database
20:04 vicash i also do what sri does, and use Migrations to cleanup the database at the end of the test run.
20:05 * sri just drops the schema https://github.com/kraih/minion/blob/master/t/pg_lite_app.t#L69
20:23 jabberwok we have come a long way since 'testing' meant 'put a freshly formatted floppy in B:'
20:26 disputin1 joined #mojo
20:31 disputin joined #mojo
20:46 [vlad] my moose attribute in my controller doesn't seem to be getting its default attrubute
20:47 [vlad] attribute even
20:47 [vlad] hmm thats a lot of attributes
20:48 [vlad] nopaste?
20:48 purl nopaste is probably http://paste.scsys.co.uk/ or http://gist.github.com/ or DO NOT USE pastebin.com IT FUCKING SUCKS or the command-line interface to App::Nopaste
20:50 pink_mist botsnack
20:50 purl thanks pink_mist :)
20:50 [vlad] http://paste.scsys.co.uk/paste
20:50 [vlad] whops
20:51 [vlad] http://paste.scsys.co.uk/539855
20:51 [vlad] hmm wtf
20:51 jberger don't use Mojo::Base AND moose
20:51 jberger use one or the other
20:52 [vlad] ok
20:52 [vlad] thanks
20:52 jberger np
21:48 polettix joined #mojo
21:49 dod joined #mojo
21:55 lluad joined #mojo
22:22 Grinnz TIL MariaDB added DELETE ... RETURNING, but of course that's not compatible with base mysql and there's no UPDATE ... RETURNING
22:24 Grinnz the only possible way to implement such a thing is with a stored procedure (ugh), and it's slow
22:25 * Grinnz just mitigates the possibility of race conditions elsewhere...
22:45 jabberwok I got the DBIx::TempDB to work with my Mojo tests, thanks again Grinnz and all.
23:18 jontaylor joined #mojo
23:19 [vlad] can i do $r->get('/')->to('Foo::Bar::baz) or must it be 'Foo::Bar#baz' ?
23:20 [vlad] missed a quote there
23:21 Grinnz the latter
23:21 purl the latter is better
23:21 Grinnz you're specifying a controller and action, not a function
23:22 [vlad] i must be missing some deep oo truth here :)
23:22 Grinnz not OO, but routing; you can't just dispatch to any function, it has to be a mojolicious controller action
23:23 jberger you can specify just a controller using Foo::Bar#
23:23 Grinnz so that mojolicious can instantiate the controller object, and is able to use it to handle the request
23:23 jberger Grinnz: for nested routing specifying a controller at one level and an action at another level (via #action) can be really handy
23:23 Grinnz sure
23:24 Grinnz i also do controller => foo or action => bar at different levels to be more explicit
23:24 jberger anyway, the stringy shortcut works, you just have to leave the # in there
23:24 Grinnz he wasn't talking about a shortcut, he was talking about a fully qualified function name
23:24 [vlad] jberger: what function will be run in the controller if i do that?
23:24 jberger oh sorry, I misread
23:24 [vlad] sorry guys this routing stuff is new to me
23:25 jberger likely is will be Foo::Bar::baz
23:25 jberger s/is/it/
23:25 jberger but it could be Foo::baz if Foo::Bar inherits from Foo and doesn't implement baz itself
23:26 jberger in the normal OO way
23:26 jberger and as Grinnz says, there are ways to hide functions from the router
23:26 Grinnz reading through https://metacpan.org/pod/Mojolicious::Guides::Routing may help
23:26 jberger for example, all _methods are hidden
23:26 jberger and you can add others
23:27 Grinnz the important thing is that it's not just calling that method
23:27 Grinnz it's instantiating a controller object, then calling the method
23:27 Grinnz so it needs both parts
23:27 [vlad] ok cool np
23:27 [vlad] just thought it would look prettier :)
23:27 [vlad] heh
23:28 jberger if you think it is prettier, you can use controller => 'Foo::Bar', action => 'baz'
23:28 Grinnz you can also define actions inline with anonymous subroutines if that's appropriate for your application
23:28 Grinnz then it just uses a generic controller object
23:29 Grinnz that's generally done with Mojolicious::Lite to keep it single-file
23:29 [vlad] yeah my project is large
23:29 Grinnz then probably not a good idea :P
23:29 Grinnz i still use inline subs for some quick routes though
23:30 [vlad] i'll just get used to the #
23:30 [vlad] seems weird not for it to be a comment
23:30 Grinnz yeah, its just a special character that the router parses
23:31 Grinnz it also means something different in the route itself: https://metacpan.org/pod/Mojolicious::Guides::Routing#Relaxed-placeholders
23:34 [vlad] ok $r->get('/:mymessage')->to('foo#bar', mymessage => 'hi');
23:34 [vlad] that routes to controller foo
23:34 [vlad] runs function bar
23:34 [vlad] i don't get how the controller gets the :mymessage bit
23:35 Grinnz everything else just goes in the stash
23:35 Grinnz which is an attribute of the controller object
23:35 [vlad] ok cool
23:35 Grinnz it's just request specific data
23:35 [vlad] i was expecting it to be in @_
23:36 Grinnz in fact 'controller' and 'action' are themselves stash values too
23:36 jberger [vlad]: mymessage => 'hi' is the route's default stash
23:36 jberger if you pass / you get the same as /hi
23:37 Grinnz oh yeah, since it's a parameter
23:37 jberger if you pass /blahblah then $c->stash('mymessage') eq 'blahblah'
23:37 Grinnz https://metacpan.org/pod/Mojolicious::Guides::Routing#Optional-placeholders
23:37 [vlad] ah cool
23:37 [vlad] thanks guys
23:38 [vlad] so
23:38 [vlad] $r->get('/:controller/:template')->to('BusinessDB#get');
23:38 jberger np, curl up with the Guides if you haven't (again if you have) because they take a little time to digest
23:38 [vlad] will get me controller and template in the stash?
23:38 jberger yep
23:38 jberger everything is controlled by the stash
23:39 Grinnz :controller and :action in the route is kind of possibly-super-useful-but-super-scary
23:39 jberger though, I don't recommend using controller action or template in the path
23:39 [vlad] heh
23:39 Grinnz since you're then letting the user route themselves, essentially
23:39 jberger template maybe
23:39 [vlad] heh
23:39 [vlad] eye have a plan
23:40 [vlad] but its going to take a while
23:40 [vlad] essentially my app does route like that
23:41 [vlad] it was doing that under catalyst
23:42 [vlad] the rest of the routing is via query parameters
23:43 Grinnz yeah dynamic routing is more of a thing in catalyst
23:43 polettix joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary