| 1 | package Tapper::API; | ||
| 2 | # git description: v5.0.1-6-g8c2b8e9 | ||
| 3 | |||
| 4 | 2 | our $AUTHORITY = 'cpan:TAPPER'; | |
| 5 | 2 | $Tapper::API::VERSION = '5.0.2'; | |
| 6 | # ABSTRACT: Tapper - REST frontend | ||
| 7 | |||
| 8 | 2 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 2 | ▶ | use Mojo::Base 'Mojolicious'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 2 | ▶ | use Tapper::Config; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 1 | ▶ | sub startup { |
|
Subroutine
startup: called CC=2 SCAR=6.9
Pod
documented
| |||
| 16 | 1 | my $self = shift; | |
| 17 | |||
| 18 | 1 | $self->plugin('TapperConfig'); | |
| 19 | 1 | my $cfg = Tapper::Config->subconfig; | |
| 20 | 1 | my $r = $self->routes; | |
| 21 | 1 | foreach my $target (@{$cfg->{api}->{routes}}) { | |
| 22 | 1 | $r->any($target->{url})->partial(1)->to($target->{module}); | |
| 23 | } | ||
| 24 | |||
| 25 | } | ||
| 26 | |||
| 27 | 2 | 1; # End of Tapper::API | |
| 28 | |||
| 29 | __END__ | ||