| 1 | package Ukigumo::Server::API; | ||
| 2 | 11 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 11 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 11 | ▶ | use parent qw/Ukigumo::Server Amon2::Web/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 11 | ▶ | use File::Spec; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | # dispatcher | ||
| 8 | 11 | ▶ | use Ukigumo::Server::API::Dispatcher; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | sub dispatch { | ||
| 11 | 0 | ▶ | my $c = shift; |
|
Subroutine
dispatch: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 12 | 0 | return Ukigumo::Server::API::Dispatcher->dispatch($c) or die "response is not generated"; | |
| 13 | } | ||
| 14 | |||
| 15 | 11 | __PACKAGE__->load_plugins( 'Web::JSON' ); | |
| 16 | |||
| 17 | # for your security | ||
| 18 | __PACKAGE__->add_trigger( | ||
| 19 | AFTER_DISPATCH => sub { | ||
| 20 | 0 | ▶ | my ( $c, $res ) = @_; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 21 | 0 | $res->header( 'X-Content-Type-Options' => 'nosniff' ); | |
| 22 | }, | ||
| 23 | 11 | ); | |
| 24 | |||
| 25 | 11 | 1; | |