Added exception handling
Added error doc mapping Moved more logic into Session middleware Added Credit example to app.psgi Made StackTrace and Debug panel automatically turn on when debug mode enabled Fixed errorHandler
This commit is contained in:
parent
2bac95fa26
commit
716bdaeb86
7 changed files with 114 additions and 145 deletions
15
app.psgi
15
app.psgi
|
|
@ -3,17 +3,18 @@ use Plack::Builder;
|
|||
use lib '/data/WebGUI/lib';
|
||||
use WebGUI;
|
||||
|
||||
my $wg = WebGUI->new( root => '/data/WebGUI', site => 'dev.localhost.localdomain.conf' );
|
||||
my $root = '/data/WebGUI';
|
||||
my $wg = WebGUI->new( root => $root, site => 'dev.localhost.localdomain.conf' );
|
||||
|
||||
builder {
|
||||
enable 'Debug', panels => [ qw(Environment Response Timer Memory Session DBITrace PerlConfig Response) ];
|
||||
enable 'Log4perl', category => 'mysite', conf => $wg->config->getWebguiRoot . '/etc/log.conf';
|
||||
|
||||
enable 'Log4perl', category => 'mysite', conf => "$root/etc/log.conf";
|
||||
enable 'Static', root => $root, path => sub { s{^/\*give-credit-where-credit-is-due\*$}{docs/credits.txt} };
|
||||
|
||||
# Open/close the WebGUI::Session at the outer-most onion layer
|
||||
enable '+WebGUI::Middleware::Session', config => $wg->config;
|
||||
|
||||
# Any additional WebGUI Middleware goes here
|
||||
# ..
|
||||
enable '+WebGUI::Middleware::Session',
|
||||
config => $wg->config;#,
|
||||
#error_docs => { 500 => "$root/www/maintenance.html" };
|
||||
|
||||
# Return the app
|
||||
$wg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue