Lines 13-19
sub startup {
Link Here
|
13 |
my ($self) = @_; |
13 |
my ($self) = @_; |
14 |
|
14 |
|
15 |
push @{$self->plugins->namespaces}, 'Koha::App::Plugin'; |
15 |
push @{$self->plugins->namespaces}, 'Koha::App::Plugin'; |
16 |
push @{$self->static->paths}, $self->home->rel_file('koha-tmpl'); |
16 |
push @{$self->static->paths}, '/usr/share/koha/opac/htdocs'; |
|
|
17 |
push @{$self->static->paths}, '/usr/share/koha/intranet/htdocs'; |
18 |
|
19 |
# Load config |
20 |
$self->plugin('Config', {file => '/etc/koha/app.conf'}); |
17 |
|
21 |
|
18 |
# Create route for all CGI scripts, need to be loaded first because of |
22 |
# Create route for all CGI scripts, need to be loaded first because of |
19 |
# CGI::Compile |
23 |
# CGI::Compile |
Lines 46-51
sub startup {
Link Here
|
46 |
|
50 |
|
47 |
$r->any('/')->to(cb => sub { shift->redirect_to('/cgi-bin/koha/opac-main.pl') }); |
51 |
$r->any('/')->to(cb => sub { shift->redirect_to('/cgi-bin/koha/opac-main.pl') }); |
48 |
$r->any('/intranet')->to(cb => sub { shift->redirect_to('/cgi-bin/koha/mainpage.pl') }); |
52 |
$r->any('/intranet')->to(cb => sub { shift->redirect_to('/cgi-bin/koha/mainpage.pl') }); |
|
|
53 |
$r->any('/*')->to(cb => sub { shift->redirect_to('/cgi-bin/koha/errors/404.pl') }); |
49 |
} |
54 |
} |
50 |
|
55 |
|
51 |
sub _before_dispatch { |
56 |
sub _before_dispatch { |
Lines 57-62
sub _before_dispatch {
Link Here
|
57 |
# Remove Koha version from URL |
62 |
# Remove Koha version from URL |
58 |
$url =~ s/_\d{2}\.\d{7}\.(js|css)/.$1/; |
63 |
$url =~ s/_\d{2}\.\d{7}\.(js|css)/.$1/; |
59 |
|
64 |
|
|
|
65 |
# Set caches for static content |
66 |
if ($url =~ /\.(js|css|gif|png)$/) { |
67 |
$c->res->headers->cache_control('public'); |
68 |
$c->res->headers->expires(Mojo::Date->new(time+86400)); |
69 |
} |
70 |
|
60 |
# See FIXME above |
71 |
# See FIXME above |
61 |
if ($url =~ m|^/api/v|) { |
72 |
if ($url =~ m|^/api/v|) { |
62 |
$url = '/api' . $url; |
73 |
$url = '/api' . $url; |