Group
Extension

Matches 1

Mojolicious-Plugin-JSONP ( T/TE/TEMPIRE/Mojolicious-Plugin-JSONP-0.04.tar.gz, TEMPIRE, 2015; MetaCPAN )
Mojolicious-Plugin-JSONP/lib/Mojolicious/Plugin/JSONP.pm ( view source; MetaCPAN )
kage Mojolicious::Plugin::JSONP;
use Mojo::Base 'Mojolicious::Plugin';

our $VERSION = '0.04';

sub register {
  my ($self, $app, $conf) = @_;

  $app->helper(
    render_jsonp => sub {
      my ($sel
ethod(json => $ref, partial => 1) . ')')
        : $self->render(json => $ref);
    }
  );
}

1;
__END__

=head1 NAME

Mojolicious::Plugin::JSONP - Render JSONP with transparent fallback to JSON

=hea
d1 SYNOPSIS

  plugin JSONP => callback => 'callback_function';

  get '/' => sub {
    shift->render_jsonp({one => 'two'});
  };

  # GET request:
  #  ?callback_function=my_function

  # Response:
 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.