|
Lines 36-49
use Koha::Caches;
Link Here
|
| 36 |
use Koha::Cache::Memory::Lite; |
36 |
use Koha::Cache::Memory::Lite; |
| 37 |
use Koha::Database; |
37 |
use Koha::Database; |
| 38 |
use Koha::DateUtils; |
38 |
use Koha::DateUtils; |
| 39 |
|
|
|
| 40 |
#BZ 16357, add timestamps to warnings |
| 41 |
use Koha::Logger; |
39 |
use Koha::Logger; |
| 42 |
|
40 |
|
| 43 |
my $logger = Koha::Logger->get({ interface => 'plack-error' }); |
|
|
| 44 |
$SIG{__WARN__} = sub { $logger->warn(shift); }; |
| 45 |
$SIG{__DIE__} = sub { $logger->fatal(shift); }; |
| 46 |
|
| 47 |
use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise |
41 |
use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise |
| 48 |
{ |
42 |
{ |
| 49 |
no warnings 'redefine'; |
43 |
no warnings 'redefine'; |
|
Lines 72-85
my $apiv1 = builder {
Link Here
|
| 72 |
$server->to_psgi_app; |
66 |
$server->to_psgi_app; |
| 73 |
}; |
67 |
}; |
| 74 |
|
68 |
|
|
|
69 |
Koha::Logger->get; |
| 70 |
|
| 75 |
builder { |
71 |
builder { |
| 76 |
enable "ReverseProxy"; |
72 |
enable "ReverseProxy"; |
| 77 |
enable "Plack::Middleware::Static"; |
73 |
enable "Plack::Middleware::Static"; |
|
|
74 |
enable "Log4perl", category => "plack"; |
| 75 |
enable "LogErrors"; |
| 76 |
enable "LogWarn"; |
| 78 |
# + is required so Plack doesn't try to prefix Plack::Middleware:: |
77 |
# + is required so Plack doesn't try to prefix Plack::Middleware:: |
| 79 |
enable "+Koha::Middleware::SetEnv"; |
78 |
enable "+Koha::Middleware::SetEnv"; |
| 80 |
|
79 |
|
| 81 |
mount '/opac' => $opac; |
80 |
mount '/opac' => $opac; |
| 82 |
mount '/intranet' => $intranet; |
81 |
mount '/intranet' => $intranet; |
| 83 |
mount '/api/v1/app.pl' => $apiv1; |
82 |
mount '/api/v1/app.pl' => $apiv1; |
| 84 |
|
|
|
| 85 |
}; |
83 |
}; |