|
Lines 35-41
sub startup {
Link Here
|
| 35 |
$self->plugin('CGIBinKoha', opac => 1); |
35 |
$self->plugin('CGIBinKoha', opac => 1); |
| 36 |
|
36 |
|
| 37 |
# Create routes for API |
37 |
# Create routes for API |
| 38 |
# FIXME This generates routes like this: /api/api/v1/... |
|
|
| 39 |
$self->plugin('RESTV1'); |
38 |
$self->plugin('RESTV1'); |
| 40 |
|
39 |
|
| 41 |
$self->plugin('CSRF'); |
40 |
$self->plugin('CSRF'); |
|
Lines 56-66
sub _before_dispatch {
Link Here
|
| 56 |
# Remove Koha version from URL |
55 |
# Remove Koha version from URL |
| 57 |
$path =~ s/_\d{2}\.\d{7}\.(js|css)/.$1/; |
56 |
$path =~ s/_\d{2}\.\d{7}\.(js|css)/.$1/; |
| 58 |
|
57 |
|
| 59 |
# See FIXME above |
|
|
| 60 |
if ($path =~ m|^/api/v|) { |
| 61 |
$path = '/api' . $path; |
| 62 |
} |
| 63 |
|
| 64 |
$c->req->url->path->parse($path); |
58 |
$c->req->url->path->parse($path); |
| 65 |
} |
59 |
} |
| 66 |
|
60 |
|