Added preloading
Removed evil overload Removed references to Apache2:: from codebase Attempted to remove circular references
This commit is contained in:
parent
30a2c09a36
commit
4d703ffd47
7 changed files with 68 additions and 13 deletions
9
app.psgi
9
app.psgi
|
|
@ -5,6 +5,7 @@ use WebGUI;
|
|||
|
||||
my $root = '/data/WebGUI';
|
||||
my $wg = WebGUI->new( root => $root, site => 'dev.localhost.localdomain.conf' );
|
||||
my $config = $wg->config;
|
||||
|
||||
builder {
|
||||
|
||||
|
|
@ -17,17 +18,17 @@ builder {
|
|||
# For PassThru, use Plack::Builder::mount
|
||||
|
||||
# Extras fallback (you should be using something else to serve static files in production)
|
||||
my ($extrasURL, $extrasPath) = ( $wg->config->get('extrasURL'), $wg->config->get('extrasPath') );
|
||||
my ($extrasURL, $extrasPath) = ( $config->get('extrasURL'), $config->get('extrasPath') );
|
||||
enable 'Static', root => "$extrasPath/", path => sub { s{^$extrasURL/}{} };
|
||||
|
||||
# Open/close the WebGUI::Session at the outer-most onion layer
|
||||
enable '+WebGUI::Middleware::Session',
|
||||
config => $wg->config,
|
||||
config => $config,
|
||||
error_docs => { 500 => "$root/www/maintenance.html" };
|
||||
|
||||
# This one uses the Session object, so it comes after WebGUI::Middleware::Session
|
||||
enable '+WebGUI::Middleware::WGAccess', config => $wg->config;
|
||||
enable '+WebGUI::Middleware::WGAccess', config => $config;
|
||||
|
||||
# Return the app
|
||||
$wg;
|
||||
$wg->psgi_app;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue