E.g I want to use json which is the result of rendering one route in 
forming output of another route. To make code in my CRUD app less and more 
reusable.

Something like this:

get '/api/:coll/:id' => sub {
   ...
   if ($self->param("coll") eq "lists") {
      ...
      push @{$o->{items}}, $self->ua->get('/api/items/'.$_->{item_id})->res
->json;
      ...

Now I'm using Mojo::UserAgent <https://metacpan.org/pod/Mojo::UserAgent> 
default 
helper <http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#ua> 
for this. Is it a good way or is there any alternatives?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to