* Dancer::Plugin::RPC ==> Example
* This example app has 5 functions grouped in 2 groups:
system: ping, version, status, list_methods
metacpan: search (query => $query)
These 5 functions are reachable with 3 different protocols (xmlrpc, jsonrpc2
and restrpc) on the same daemon.
* Dependencies
This example code uses some extra dependencies, I've stated all of them in the cpanfile.
To install these dependencies in the local directory using Carton:
$ cd example
$ carton install
This installs all dependencies in the example/local directory.
* Start Example app
Start the Example daemon (simple way it's a Deamon::Control wrapper`):
$ cd example
$ carton exec -- bin/example.pl <start | foreground>
* Testing Example app
Testing the daemon (with bin/do-rpc):
$ cd example
Any of:
query Dancer::Plugin::RPC
query Dancer::Plugin::RPC
query Dancer::Plugin::RPC
* Stop Example app
Stop the Example daemon (simple way):
$ cd example
$ carton exec -- bin/example.pl stop
Or just press ^C if you started the daemon in the foreground.
* Different port
As 3000 seems a popular port, one can also run the example-deamon on a different port:
$ APP_PORT=3456 carton exec -- bin/example.pl <start | foreground>