Kelp::Module::Raisin - Raisin integration with Kelp
# in config - order matters modules => [qw(Symbiosis Raisin)], modules_init => { # optional Symbiosis => { mount => '/path', # will mount Kelp under /path }, # required Raisin => { mount => '/api', # will mount Raisin under /api class => 'My::Raisin', # required - full class name of Raisin app }, }, # in application's build method $self->raisin->add_route( method => 'GET', path => '/from-kelp', params => {}, code => sub { 'Hello World from Kelp, in Raisin!' }, ); # in psgi script $app = MyKelpApp->new; $app->run_all;
This is a very straightforward module that integrates the Kelp framework with the Raisin API framework using Kelp::Module::Symbiosis. See the documentation for Kelp::Module::Symbiosis and Kelp::Module::Symbiosis::Base for a full reference on how this module behaves.
This module name is 'raisin'. You can refer to it with that name in Symbiosis methods - loaded and mounted. There shouldn't be a need to, since it will be mounted automatically if you specify "mount" in configuration.
The module class itself does not expose anything particularly interesting, it is just a wrapper for Raisin.
my $raisin = $kelp->raisin;
Returns the running instance of Raisin.
Same as "middleware, middleware_init" in Kelp::Module::Symbiosis::Base. Since Raisin can wrap itself in its own middleware it will likely not be that useful.
See "mount" in Kelp::Module::Symbiosis::Base for details.
Should be a full name of the package that defines an api using Raisin::API. Keep in mind that Raisin::API is really a singleton so it is not suitable for multiple app setup.
Kelp, the framework
Raisin, the API framework
Bartosz Jarzyna, <brtastic.dev@gmail.com>
Copyright (C) 2020 by Bartosz Jarzyna
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
To install Kelp::Module::Raisin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Kelp::Module::Raisin
CPAN shell
perl -MCPAN -e shell install Kelp::Module::Raisin
For more information on module installation, please visit the detailed CPAN module installation guide.