MojoX::ConfigAppStart - Start a Mojolicious application with Config::App
version 1.03
# look for "mojo_app_lib" value in Config::App configuration
use MojoX::ConfigAppStart;
MojoX::ConfigAppStart->start;
# provide explicit Mojolicious application control library on start call
use MojoX::ConfigAppStart;
MojoX::ConfigAppStart->start('Application::Control');
# provide explicit Mojolicious application control library on use call
use MojoX::ConfigAppStart 'Application::Control';
MojoX::ConfigAppStart->start;
The goal of this module is to provide a simplified way to spin up Mojolicious applications based on settings from a Config::App configuration system.
If you have either MOJO_MODE
or PLACK_ENV
defined as enviornment
variables, the value will be used as the Config::App enviornment definition.
If not defined at all, then "development" will be used. What this means in
practice is that from the commandline, calling morbo
or hypnotoad
typically does what you want and expect.
The following is effectively equivalent to using this module, except that the
Application::Control
library is derived:
BEGIN {
$ENV{CONFIGAPPENV} = $ENV{MOJO_MODE} || $ENV{PLACK_ENV} || 'development';
}
use Config::App;
use Mojolicious::Commands;
Mojolicious::Commands->start_app('Application::Control');
The following is the only method provided:
The start()
method calls Mojolicious::Commands's start_app()
and
returns the result.
MojoX::ConfigAppStart->start;
It can optionally be provided an explicit module name:
MojoX::ConfigAppStart->start('Application::Control');
You can look for additional information at:
Gryphon Shafer gryphon@cpan.org
This software is Copyright (c) 2018-2050 by Gryphon Shafer.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)