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

IRC log for #mojo, 2017-04-21

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

All times shown according to UTC.

Time Nick Message
00:40 kiwiroy joined #mojo
00:47 Lee joined #mojo
00:54 disputin joined #mojo
01:59 chandwki joined #mojo
02:00 chandwki joined #mojo
02:06 noganex joined #mojo
02:07 jnbek joined #mojo
03:58 jabberwok joined #mojo
04:04 dboehmer joined #mojo
05:17 batman Uno's was awesome! :)
05:51 janl joined #mojo
06:10 dod joined #mojo
06:23 prg joined #mojo
06:33 Vandal joined #mojo
06:35 dod joined #mojo
06:41 dod joined #mojo
06:54 janl joined #mojo
06:58 tisajkar joined #mojo
07:15 karjala_ joined #mojo
07:20 trone joined #mojo
07:28 AndrewIsh joined #mojo
07:41 inokenty-w joined #mojo
07:56 kiwiroy joined #mojo
08:32 dod joined #mojo
08:41 dod joined #mojo
08:56 dod joined #mojo
09:02 rshadow joined #mojo
09:04 gregf_ joined #mojo
09:20 MikePM joined #mojo
09:48 salv0 joined #mojo
09:57 kiwiroy joined #mojo
10:51 kes joined #mojo
10:55 salv0 joined #mojo
12:08 trone joined #mojo
12:09 kiwiroy joined #mojo
12:31 dod joined #mojo
12:43 dod joined #mojo
12:52 ladnaV25714 joined #mojo
12:55 gryphon joined #mojo
12:57 gryphon left #mojo
13:19 trone joined #mojo
13:36 vicash left #mojo
13:45 gizmomathboy joined #mojo
13:52 zivester joined #mojo
14:06 Vandal joined #mojo
14:09 kiwiroy joined #mojo
14:28 karjala_ For some reason morbo -w /full/path won't restart on modifications (on my Fedora desktop) - how do I go about debugging that?
14:28 karjala_ morbo -w ... -l ... app.pl
14:30 karjala_ actually, it did reload. But silently - no output on the console to let me know that it found modifications and that it's restarting.
14:42 karjala_ is that how it's supposed to reload? silently?
14:50 PryMar56 joined #mojo
14:56 gryphon joined #mojo
14:57 khfeng joined #mojo
15:08 maschine I've never seen it load anything other than silently
15:10 kiwiroy joined #mojo
15:13 sri morbo -h
15:14 khfeng_ joined #mojo
15:15 karjala_ oh, -v does the trick
15:22 janl joined #mojo
15:26 Lee joined #mojo
15:27 disputin joined #mojo
15:39 itaipu joined #mojo
15:49 jberger sri: if I stash a value in an under, should I be able to see that value in a condition?
15:54 miller joined #mojo
15:55 rshadow joined #mojo
16:02 jberger oh, it seems like conditions happen before unders?
16:02 jberger that is surprising
16:09 dexteruk joined #mojo
16:09 dexteruk Hi Everyone
16:09 purl Howdy, dexteruk, you fantastic person you.
16:10 dexteruk Just a quick question im doing something new with mojolicious, i decided to see if i can use it to create a front end web app using bootstrap
16:11 dexteruk my quesiton is i use the useragent to query an api server, it return me a json string.  I need to get that json string into jquery DataTable
16:12 dexteruk I have no clue how to do it, and i can find little information online
16:12 nic DataTable has many options.  Which one are you aiming for?
16:13 dexteruk well i was looking at serverside
16:13 nic for that case, you put the data into an html table and tell dt the id of the table
16:13 dexteruk i have structure the data already on the api side
16:14 jberger then you ajax request to get it
16:14 nic I think it's more interesting (ie more useful) to get dt to request the data from the server instead
16:14 jberger or that
16:14 dexteruk yes i tried that, but i need to get a sessionkey from the session
16:14 dexteruk and pass that as header
16:14 jberger sorry, I haven't used dt before, yeah if it can fetch its own data then that's the best
16:15 dexteruk to the js
16:15 nic is the data uber-sensitive?
16:16 dexteruk and to be honest i just wanted the user to see the data and not the backend stuff
16:16 dexteruk which i thought if it do it from the controller itself get the data and simply pass that somehow to javascript then it will only see the data
16:17 nic When the server creates the page (to an auth'd user) the template puts a token in the html that tells dt the url for the data
16:17 dexteruk and not the sessionkey etc
16:17 nic so when dt calls that url, it just happens to be passing the correct token as a query param
16:18 nic Are you with me?
16:18 dexteruk not really :-(
16:18 dexteruk dt?
16:18 purl somebody said dt was not a hard dep of dbic, since IC::DT is an optional component
16:18 nic It would be horribly clunky if not using Mojolicious
16:19 nic DataTable
16:19 dexteruk ok i understand
16:19 nic s/e/es/
16:19 dexteruk so use the html dom to pass the data
16:20 dexteruk to js
16:20 nic hang on, have you checked you need to do anything special?  I _think_ dt will be passing the cookie that tells the server its authenticated
16:21 jberger sri: this example surprises me
16:21 jberger perl -Mojo -E 'my $r = app->routes; $r->add_condition(test => sub { warn "Condition"; 1}); $r->under("/hello" => sub { warn "Under"; 1})->get("/world" => test => undef, sub { warn "Endpoint"; $_->render(text => "done") }); app->start' get /hello/world
16:21 nic dexteruk: No, I'm suggesting you take a better path, which is to pass no data in the html, just the url, and let dt get the data itself
16:22 jberger I get Condition before Under even though the condition is clearly on the child route
16:22 nic that works better because as your use of dt gets more sophisticated, there are instances where you want dt to (re)fetch data
16:23 dexteruk ok im looking at the serverside options
16:24 dexteruk i see no mention to cookies
16:24 sh14 joined #mojo
16:27 Pyritic joined #mojo
16:34 nic just test it.  Confirm that an unauthenticated user cannot fetch the json from the server, but dt can (when invoked inside an authenticated session)
16:35 * nic makes glorious schoolboy error
16:35 nic I thought that while building up this music app it was ok to have all the http methods be 'get'
16:35 nic oh dear
16:36 nic I wasn't aware of the liberty chrome takes with pre-fetching urls it anticipates you'll want
16:36 nic and...  quite a few of my URLs entail server-side effects
16:37 nic Could not work out why the music was starting to play a few seconds after step #1, when I hadn't invoked step #2 yet
16:38 Grinnz yes, don't use GET for requests that change stuff
16:38 nic yeah, hence the "schoolboy error" comment :)
16:38 nic I thought I was safe, and chrome that it was being helpful :)
16:38 Grinnz http://restcookbook.com/HTTP%20Methods/idempotency/
16:39 nic yes, and the message for the kids at home -- sometimes that matters while still in the proof-of-concept stage :)
16:40 rshadow joined #mojo
16:54 rshadow joined #mojo
17:09 kiwiroy joined #mojo
17:37 * jberger has learned a lot about the router today :-P
17:43 jacobydave joined #mojo
17:49 jberger I now understand my confusion before btw
17:55 kiwiroy joined #mojo
18:16 stryx` joined #mojo
18:37 dod joined #mojo
18:57 khfeng joined #mojo
19:01 dikim joined #mojo
19:29 rshadow joined #mojo
19:44 Janos joined #mojo
19:49 disputin joined #mojo
19:57 itaipu joined #mojo
20:24 jberger maybe I'm missing something, but from the mailing list, why would you do this? https://gist.github.com/ufobat/d6236c1860aea87bf5a94c06ed5b3ae5
21:16 castaway joined #mojo
21:22 itaipu joined #mojo
22:06 marcus joined #mojo
22:06 batman joined #mojo
22:47 zivester joined #mojo
22:48 tchaves joined #mojo
22:58 stryx` joined #mojo

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