1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
use Poet::Script qw($conf $env);
use Plack::Builder;
use Plack::Session::Store::Cache;
use strict;
use warnings;
# Load modules configured in server.load_modules
#
$env->app_class('Server')->load_startup_modules();
builder {
# Add Plack middleware here
#
if ( $conf->is_development ) {
enable "Plack::Middleware::StackTrace";
enable "Plack::Middleware::Debug";
}
enable "Plack::Middleware::Static",
path => qr{^/static/},
root => $env->root_dir;
enable "Plack::Middleware::Session",
store => Plack::Session::Store::Cache->new(
cache => $env->app_class('Cache')->new( namespace => 'session' ) );
sub {
my $psgi_env = shift;
$env->app_class('Mason')->handle_psgi($psgi_env);
};
};
|