| 1 | package CPAN::Mini::Inject::REST::Controller::Root; | ||
| 2 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | BEGIN { extends 'Catalyst::Controller' } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | # | ||
| 8 | # Sets the actions in this controller to be registered with no prefix | ||
| 9 | # so they function identically to actions created in MyApp.pm | ||
| 10 | # | ||
| 11 | 1 | __PACKAGE__->config(namespace => ''); | |
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | CPAN::Mini::Inject::REST::Controller::Root - Root Controller for CPAN::Mini::Inject::REST | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | [enter your description here] | ||
| 20 | |||
| 21 | =head1 METHODS | ||
| 22 | |||
| 23 | =head2 index | ||
| 24 | |||
| 25 | The root page (/) | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | 1 | ▶ | sub index :Path :Args(0) { |
|
Subroutine
index: called CC=1 SCAR=0.0
Pod
documented
| |||
| 30 | 1 | my ( $self, $c ) = @_; | |
| 31 | |||
| 32 | # Hello World | ||
| 33 | 1 | $c->response->body( $c->welcome_message ); | |
| 34 | 1 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | |||
| 36 | =head2 default | ||
| 37 | |||
| 38 | Standard 404 error page | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | 0 | ▶ | sub default :Path { |
|
Subroutine
default: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 43 | 0 | my ( $self, $c ) = @_; | |
| 44 | 0 | $c->response->body( 'Page not found' ); | |
| 45 | 0 | $c->response->status(404); | |
| 46 | 1 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 47 | |||
| 48 | =head2 end | ||
| 49 | |||
| 50 | Attempt to render a view, if needed. | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | 1 | ▶ | sub end : ActionClass('RenderView') {} |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
end: called CC=1 SCAR=0.0
Pod
documented
| |||
| 55 | |||
| 56 | =head1 AUTHOR | ||
| 57 | |||
| 58 | Jon Allen (JJ) | ||
| 59 | |||
| 60 | =head1 LICENSE | ||
| 61 | |||
| 62 | This library is free software. You can redistribute it and/or modify | ||
| 63 | it under the same terms as Perl itself. | ||
| 64 | |||
| 65 | =cut | ||
| 66 | |||
| 67 | 1 | __PACKAGE__->meta->make_immutable; | |
| 68 | |||
| 69 | 1 | 1; | |