NAME

Kelp::Module::Raisin - Raisin integration with Kelp

SYNOPSIS

        # 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;

DESCRIPTION

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.

MODULE INFORMATION

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.

METHODS INTRODUCED TO KELP

raisin

        my $raisin = $kelp->raisin;

Returns the running instance of Raisin.

CONFIGURATION

middleware, middleware_init

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.

mount

See "mount" in Kelp::Module::Symbiosis::Base for details.

class

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.

SEE ALSO

AUTHOR

Bartosz Jarzyna, <brtastic.dev@gmail.com>

COPYRIGHT AND LICENSE

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.