Amon2::Plugin::Web::JSON - JSON plugin
use Amon2::Lite; __PACKAGE__->load_plugins(qw/Web::JSON/); get '/' => sub { my $c = shift; return $c->render_json(+{foo => 'bar'}); }; __PACKAGE__->to_app();
This is a JSON plugin.
Generate JSON data from \%dat and returns instance of Plack::Response.
\%dat
You can use JSONP by using Plack::Middleware::JSONP.
See the hasegawayosuke's article(Japanese).
hasegawayosuke
To install Amon2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amon2
CPAN shell
perl -MCPAN -e shell install Amon2
For more information on module installation, please visit the detailed CPAN module installation guide.