-
-
24 Feb 2021 11:04:26 UTC
- Distribution: MojoX-JSON-RPC
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (9)
- Testers (205 / 0 / 0)
- Kwalitee
Bus factor: 1- 80.90% Coverage
- License: artistic_2
- Activity
24 month- Tools
- Download (16.59KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Henry Tang
- Dependencies
- Mojolicious
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
MojoX::JSON::RPC::Dispatcher - A JSON-RPC 2.0 server for Mojolicious
SYNOPSIS
# lib/your-application.pm use base 'Mojolicious'; use MojoX::JSON::RPC::Service; sub startup { my $self = shift; my $svc = MojoX::JSON::RPC::Service->new; $svc->register( 'sum', sub { my @params = @_; my $sum = 0; $sum += $_ for @params; return $sum; } ); $self->plugin( 'json_rpc_dispatcher', services => { '/jsonrpc' => $svc } ); }
DESCRIPTION
Using this module you can handle JSON-RPC 2.0 requests within Mojolicious.
ATTRIBUTES
MojoX::JSON::RPC::Dispatcher inherits all attributes from Mojolicious::Controller and implements the following attributes.
json
JSON encoder / decoder
error_code
Error code.
error_message
Error message.
error_data
Error data.
id
METHODS
MojoX::JSON::RPC::Dispatcher inherits all methods from Mojolicious::Controller and implements the following new ones.
call
Process JSON-RPC call.
SEE ALSO
Module Install Instructions
To install MojoX::JSON::RPC, copy and paste the appropriate command in to your terminal.
cpanm MojoX::JSON::RPC
perl -MCPAN -e shell install MojoX::JSON::RPC
For more information on module installation, please visit the detailed CPAN module installation guide.