Group
Extension

Matches 1

JSON-RPC-Lite ( N/NQ/NQOUNET/JSON-RPC-Lite-v1.0.0.tar.gz, NQOUNET, 2014; MetaCPAN )
JSON-RPC-Lite/lib/JSON/RPC/Lite.pm ( view source; MetaCPAN )
package JSON::RPC::Lite;
use strict;
use warnings;

use version; our $VERSION = version->declare("v1.0.0");

use JSON::RPC::Spec;
use Plack::Request;

sub import {
    my $pkg    = caller(0);
    my $
rpc    = JSON::RPC::Spec->new;
    my $method = sub ($$) {
        $rpc->register(@_);
    };
    no strict 'refs';
    *{"${pkg}::method"}      = $method;
    *{"${pkg}::as_psgi_app"} = sub {
       
my $body   = $rpc->parse($req->content);
            my $header = ['Content-Type' => 'application/json'];
            if (length $body) {
                return [200, $header, [$body]];
            }

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