Lines 19-24
use Modern::Perl;
Link Here
|
19 |
use Mojo::Base 'Mojolicious'; |
19 |
use Mojo::Base 'Mojolicious'; |
20 |
|
20 |
|
21 |
use C4::Auth qw( check_cookie_auth get_session ); |
21 |
use C4::Auth qw( check_cookie_auth get_session ); |
|
|
22 |
use C4::Context; |
22 |
use Koha::Borrowers; |
23 |
use Koha::Borrowers; |
23 |
|
24 |
|
24 |
sub startup { |
25 |
sub startup { |
Lines 42-47
sub startup {
Link Here
|
42 |
# Force charset=utf8 in Content-Type header for JSON responses |
43 |
# Force charset=utf8 in Content-Type header for JSON responses |
43 |
$self->types->type(json => 'application/json; charset=utf8'); |
44 |
$self->types->type(json => 'application/json; charset=utf8'); |
44 |
|
45 |
|
|
|
46 |
my $secret_passphrase = C4::Context->config('api_secret_passphrase'); |
47 |
if ($secret_passphrase) { |
48 |
$self->secrets([$secret_passphrase]); |
49 |
} |
50 |
|
45 |
$self->plugin(Swagger2 => { |
51 |
$self->plugin(Swagger2 => { |
46 |
route => $route, |
52 |
route => $route, |
47 |
url => $self->home->rel_file("api/v1/swagger.json"), |
53 |
url => $self->home->rel_file("api/v1/swagger.json"), |