don't preload for development, and encode output as UTF-8
This commit is contained in:
parent
defb78ab64
commit
99386f52eb
2 changed files with 10 additions and 1 deletions
6
app.psgi
6
app.psgi
|
|
@ -1,8 +1,12 @@
|
|||
use strict;
|
||||
use Plack::Builder;
|
||||
use WebGUI::Paths -preload;
|
||||
use WebGUI::Paths -inc;
|
||||
use WebGUI::Config;
|
||||
|
||||
if ($ENV{PLACK_ENV} ne 'development') {
|
||||
WebGUI::Paths->preloadAll;
|
||||
}
|
||||
|
||||
builder {
|
||||
my $first_app;
|
||||
for my $config_file (WebGUI::Paths->siteConfigs) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@ builder {
|
|||
my $config = $wg->config;
|
||||
|
||||
enable 'Log4perl', category => $config->getFilename, conf => WebGUI::Paths->logConfig;
|
||||
enable 'SimpleContentFilter', filter => sub {
|
||||
if ( utf8::is_utf8($_) ) {
|
||||
utf8::encode($_);
|
||||
}
|
||||
};
|
||||
|
||||
# Reproduce URL handler functionality with middleware
|
||||
enable '+WebGUI::Middleware::Snoop';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue