1 package LolCatalyst::Lite::Controller::Root;
5 use parent 'Catalyst::Controller';
7 __PACKAGE__->config->{namespace} = '';
9 sub index :Path :Args(0) {
10 my ( $self, $c ) = @_;
14 my ( $self, $c ) = @_;
15 $c->response->status(404);
16 $c->response->body( 'Page not found' );
19 sub translate :Local {
21 my $lol = $c->req->body_params->{lol}; # only for a POST request
22 # $c->req->params->{lol} would catch GET or POST
23 # $c->req->query_params would catch GET params only
26 result => $c->model('Translator')->translate($lol),
27 template => 'index.tt',
31 sub translate_service : Local {
33 $c->forward('translate');
34 $c->stash->{current_view} = 'Service';
37 sub end : ActionClass('RenderView') {
39 my $errors = scalar @{$c->error};
42 $c->res->body('internal server error');