X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=app.psgi;fp=app.psgi;h=7ff4c251236fb37a9d88bf84b59cfa9499e283cf;hb=56a2f9f3a1f2283abc1ebfb920e29435a1710c46;hp=612eee18b6e054fb162f138c73e4bc00d94dd1a6;hpb=9271237579206cb1451fba93b0ebdd8ac0e2b12b;p=koha.git diff --git a/app.psgi b/app.psgi index 612eee18b6..7ff4c25123 100755 --- a/app.psgi +++ b/app.psgi @@ -3,6 +3,7 @@ use CGI::Compile; use CGI::Emulate::PSGI; use Plack::App::URLMap; +use Plack::App::Directory; use lib '/srv/koha'; my $app = Plack::App::URLMap->new; @@ -13,6 +14,7 @@ my $to = '/cgi-bin/koha'; foreach my $script ( glob "$from/*" ) { my $path = $script; $path =~ s{^$from}{} || die; + $path =~ s{^/+}{}; my $sub = eval { CGI::Compile->compile($script) }; @@ -22,8 +24,10 @@ foreach my $script ( glob "$from/*" ) { } my $cgi_app = CGI::Emulate::PSGI->handler($sub); - $app->mount( "$to/$path", $cgi_app ); + $app->mount( "$to/$path" => $cgi_app ); warn "# script $script -> $to/$path"; } +$app->mount( '/' => Plack::App::Directory->new( { root => '/srv/koha/koha-tmpl/' } )->to_app ); + $app;