Skip to content

Instantly share code, notes, and snippets.

@arodland
Created July 11, 2009 05:16
Show Gist options
  • Save arodland/145084 to your computer and use it in GitHub Desktop.
Save arodland/145084 to your computer and use it in GitHub Desktop.
package JSONTest::Controller::JSON;
use strict;
use warnings;
use base 'Catalyst::Controller';
sub echo : JSONRPCPath('/echo') {
my ($self, $c, @args) = @_;
$c->stash->{jsonrpc} = join ', ', @args;
}
1;
package JSONTest;
use strict;
use warnings;
use Catalyst::Runtime '5.70';
use parent qw/Catalyst/;
use Catalyst qw/-Debug
ConfigLoader
Static::Simple
Server
Server::JSONRPC
/;
our $VERSION = '0.01';
__PACKAGE__->config( name => 'JSONTest',
jsonrpc => {
path => qr!^(/?)jsonrpc(/|$)!, # This is the "entrypoint" URL.
},
);
__PACKAGE__->setup();
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment