4 use CGI::Emulate::PSGI;
5 use Plack::App::URLMap;
6 use Plack::App::Directory;
9 my $app = Plack::App::URLMap->new;
11 my $from = '/srv/koha/opac';
12 my $to = '/cgi-bin/koha';
14 foreach my $script ( glob "$from/*" ) {
16 $path =~ s{^$from}{} || die;
19 my $sub = eval { CGI::Compile->compile($script) };
22 warn "ERROR: can't compile $script: $@";
26 my $cgi_app = CGI::Emulate::PSGI->handler($sub);
27 $app->mount( "$to/$path" => $cgi_app );
28 warn "# script $script -> $to/$path";
31 $app->mount( '/' => Plack::App::Directory->new( { root => '/srv/koha/koha-tmpl/' } )->to_app );