4 use Catalyst qw/-Engine=HTTP/;
7 __PACKAGE__->config( name => 'ExternalCatty' );
10 sub default : Private {
11 my ( $self, $c ) = @_;
12 $c->response->content_type('text/html; charset=utf-8');
13 $c->response->output( html( 'Root', 'Hello, test ☺!' ) );
16 # redirect to a redirect
18 my ( $self, $context ) = @_;
19 my $where = $context->uri_for('/');
20 $context->response->redirect($where);
25 my ( $title, $body ) = @_;
29 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37 # The Cat HTTP server background option is useless here :-(
38 # Thus we have to provide our own background method.
43 die "Can't fork Cat HTTP server: $!" unless defined $child;
44 return $child if $child;
46 if ( $^O !~ /MSWin32/ ) {
48 POSIX::setsid() or die "Can't start a new session: $!";