package Plack::App::JSONRPC;
use 5.008001;
use strict;
use warnings;
our $VERSION = "0.02";
use parent qw(Plack::Component);
use JSON::RPC::Spec;
use Plack::Request;
use Plack::Util::Accessor qw(rpc)
;
sub prepare_app {
my ($self) = @_;
my $rpc = JSON::RPC::Spec->new;
while (my ($name, $callback) = each %{$self->{methods}}) {
$rpc->register($name, $callback);
}
$self->
tent-Type' => 'application/json'], [$body]];
}
return [204, [], []];
}
1;
__END__
=encoding utf-8
=head1 NAME
Plack::App::JSONRPC - (DEPRECATED) Yet another JSON-RPC 2.0 psgi application