NAME
RapidApp::Builder - Plack-compatable, runtime-generated RapidApp loader
SYNOPSIS
use RapidApp::Builder;
my $builder = RapidApp::Builder->new(
debug => 1,
appname => "My::App",
plugins => [ ... ],
config => { ... }
);
# Plack app:
$builder->to_app
DESCRIPTION
This module is an extension to both Plack::Component and CatalystX::AppBuilder and facilitates programatically creating/instantiating a RapidApp application without having to setup/bootstrap files on disk. As a Plack::Component, it can also be used anywhere Plack is supported, and can subclassed in the same manner as any Plack::Component class.
...
CONFIGURATION
appname
Class name of the RapidApp/Catalyst app to be built.
base_appname
Alternative to appname
, but will append a number if the specified class already exists (loaded or unloaded, but found in @INC). For example, if set to MyApp
, if MyApp already exists, the appname is set to <MyApp1>, if that exists it is set to MyApp2
and so on.
plugins
List of Catalyst plugins to load. The plugin 'RapidApp' is always loaded, and '-Debug' is loaded when debug
is set.
inject_components
Optional list of components (i.e. Catalyst Models, Views and Controllers) to inject into the application. These should be specified as 2-value ArrayRefs with the class name to inject as the first argument, and the name to inject it as in the application (relative to the app namespace) as the second argument.
For example, to inject a controller named 'Blah':
inject_components => [
[ 'Some::Catalyst::Controller::Foo' => 'Controller::Blah' ]
]
debug
Boolean flag to enable debug output in the application. When set, adds -Debug
to the plugins list.
version
The $VERSION
string to use
METHODS
psgi_app
Same as to_app
to_app
PSGI $app
CodeRef. Derives from Plack::Component
SEE ALSO
AUTHOR
Henry Van Styn <[email protected]>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by IntelliTree Solutions llc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.