Group
Extension

Matches 4

JSTAPd ( Y/YA/YAPPO/JSTAPd-0.03.tar.gz, YAPPO, 2012; MetaCPAN )
JSTAPd/lib/JSTAPd/Server.pm ( view source; MetaCPAN )
rver;
use strict;
use warnings;
use AE;
use Data::Dumper;
use File::ShareDir;
use File::Spec;
use JSON::XS;
use HTTP::Request;
use LWP::UserAgent;
use Path::Class;
use Time::HiRes;

use Plack::App::Di
th, $req, $session);
        $res ||= Plack::Response->new( 200, [ 'Content-Type' => 'application/json' ], '{msg:"ok"}' );

    } elsif ($apiurl && $req->uri->path =~ /$apiurl/) {
        # ajax reque
quest}->{requests} ];
            $current->{pop_tap_request}->{cv}->send(
                $self->json_response($stack)
            );
        }
    } else {
        # ajax request?
        my $path =
JSTAPd ( Y/YA/YAPPO/JSTAPd-0.03.tar.gz, YAPPO, 2012; MetaCPAN )
JSTAPd/lib/JSTAPd/Manual/Test.pod ( view source; MetaCPAN )
s'
  }

The return value can be any Perl construct. If it's a reference, the return value will be JSON encoded. Otherwise it will be passed as-is.

The C<server_api()> function takes the following par
JSTAPd ( Y/YA/YAPPO/JSTAPd-0.03.tar.gz, YAPPO, 2012; MetaCPAN )
JSTAPd/lib/JSTAPd/Tutorial/JA.pod ( view source; MetaCPAN )
文字列でも構いません。オブジェクトの場合は L<JSON::XS> にて JSON encode された結果が戻ります。
JSON::XS が使われるのが嫌な場合には、自前で文字列
JSTAPd ( Y/YA/YAPPO/JSTAPd-0.03.tar.gz, YAPPO, 2012; MetaCPAN )
JSTAPd/lib/JSTAPd/Server/Contents.pm ( view source; MetaCPAN )
en     => $server->auto_open,
        )
    );
}

package JSTAPd::Server::Contents::contents;
use JSON::XS ();

sub AUTOLOAD {
    my($class, $server, $req, $session, $args) = @_;
    my $path = our $
   if (ref($ret)) {
        return Plack::Response->new(200, [ 'Content-Type' => 'application/json' ], JSON::XS->new->ascii->encode($ret) );
    } else {
        return Plack::Response->new(200, [ 'Co

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