1 use CatalystX::Declare;
3 # we consume a role that does what the RenderView action class
5 controller MyApp::Web::Controller::Root
6 with MyApp::Web::ControllerRole::RenderView {
8 # $CLASS is provided by CLASS.pm
9 $CLASS->config->{namespace} = '';
12 # this is the common root action for all other actions
13 action base under '/' as '';
15 # we group all our root actions under the common base
18 # this action catches /
19 final action root as '' {
21 $ctx->response->body( $ctx->welcome_message );
24 # this action takes all other /* parts. the (@) signature
25 # says we don't care about the arguments
26 final action not_found (@) as '' {
28 $ctx->response->body( 'Page Not Found' );
29 $ctx->response->status( 404 );