Created
February 4, 2019 15:00
-
-
Save marcusramberg/d0444a8b1eb5ac5b179cf6c171107a8a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
get '/' => sub { | |
my $c = shift; | |
$c->render_later; | |
$c->ua->get('/internal', sub { | |
my ($ua,$tx)=@_; | |
$c->render(text=>$tx->res->json('/res')); | |
}); | |
}; | |
get '/internal' => sub { | |
my $c = shift; | |
$c->render( json=> {res=>'2'} ); | |
}; | |
app->start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment