Hello,
I am having an issue with Catalyst::Controller::REST, which I am trying to
use with mod_perl2 on apache2. For some reason in my handler, I need to
define a handler sub, in which case "hello world" does get returned:
sub handler{
my $r = shift;
$r->content_type('text/plain');
print "hello world\n";
return Apache2::Const::OK;
}
Otherwise, modperl2 complains that the handler method is missing.
My settings in apache2 conf are as follows:
PerlModule app
<Location /loc>
SetHandler perl-script
PerlResponseHandler app
</Location>
The code is as follows:
app.pm:
package app;
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => qw(OK);
use Moose;
use namespace::autoclean;
BEGIN { extends 'Catalyst::Controller::REST' }
sub hello :Local :ActionClass('REST') {
print "handler entered\n";
}
sub hello_GET {
my ( $self, $c ) = @_;
$self->status_ok(
$c,
entity => {
some => 'data',
foo => 'is real bar-y',
},
);
}
1;
Thanks in advance for the help!
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/