Created
February 29, 2020 22:52
-
-
Save daoswald/2abd9d3b437863ee8b0b7c569be54616 to your computer and use it in GitHub Desktop.
This file contains 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
curl -l http://localhost:3000/bar.html | |
HASH(0x55bcb62743c8) | |
cat myapp.pl | |
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
get '/bar' => sub { | |
my $data = {one => {foo => 1}, two => 24}; | |
shift()->respond_to( | |
json => {json => $data}, | |
any => {template => 'mytest', data => $data}, | |
); | |
}; | |
app->start; | |
__DATA__ | |
@@ mytest.html.ep | |
<p> | |
The data is:</p> | |
<pre> | |
%= dumper $data | |
</pre> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment