Mojolicious::Plugin::QooxdooJsonrpc - handle qooxdoo Jsonrpc requests
# lib/your-application.pm use base 'Mojolicious'; use RpcService; sub startup { my $self = shift; $self->plugin('qooxdoo_json_rpc',{ prefix => '/', path => 'jsonrpc', services => { Test => RpcService->new(), }, }); }
This plugin installs the MojoX::Dispatcher::Qooxdoo::Jsonrpc dispatcher into your application. The result of your build run is expected in the public/ directory of your mojo app.
See the documentation on MojoX::Dispatcher::Qooxdoo::Jsonrpc for details on how to write your service.
The plugin understands the following parameters.
By default the plugin will add its routes starting at the root / by setting a prefix you can move them down the tree.
A pointer to a hash of service instances. See MojoX::Dispatcher::Qooxdoo::Jsonrpc for details on how to write a service.
If your application expects the JsonRPC service to appear under a different url.
While developing your qooxdoo application it is handy to run its souce version. Normally this is done directly from the file system, but in that mode your application will not be able to call back to the server with POST requests.
This module provides a qooxdoo source mode where it will serve the source version of your application. Set the QX_SRC_MODE environment variable to "1" to activate the source mode. By default, the module expects to find the source of your application in MOJO_HOME/../frontend/source if you keep the source somewhere else you can set the alternate location via QX_SRC_PATH either absolute or relative to the MOJO_HOME directory.
QX_SRC_MODE
QX_SRC_PATH
In production mode, the plugin expects to find the result of your generate.py build run in mojos public directory.
generate.py build
Tobias Oetiker, <tobi@oetiker.ch>
Copyright OETIKER+PARTNER AG 2010
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install MojoX::Dispatcher::Qooxdoo::Jsonrpc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MojoX::Dispatcher::Qooxdoo::Jsonrpc
CPAN shell
perl -MCPAN -e shell install MojoX::Dispatcher::Qooxdoo::Jsonrpc
For more information on module installation, please visit the detailed CPAN module installation guide.