with 'Catalyst::ScriptRole';
has debug => (
+ traits => [qw(Getopt)],
cmd_aliases => 'd',
isa => Bool,
is => 'ro',
);
has host => (
+ traits => [qw(Getopt)],
isa => Str,
is => 'ro',
default => 'localhost',
);
has fork => (
+ traits => [qw(Getopt)],
cmd_aliases => 'f',
isa => Bool,
is => 'ro',
documentation => 'Fork the server',
);
-has listen => (
- cmd_aliases => 'l',
+has port => (
+ traits => [qw(Getopt)],
+ cmd_aliases => 'p',
isa => Int,
is => 'ro',
default => 3000,
);
has pidfile => (
+ traits => [qw(Getopt)],
cmd_aliases => 'pid',
isa => Str,
is => 'ro',
);
has keepalive => (
+ traits => [qw(Getopt)],
cmd_aliases => 'k',
isa => Bool,
is => 'ro',
);
has background => (
+ traits => [qw(Getopt)],
cmd_aliases => 'bg',
isa => Bool,
is => 'ro',
);
has restart => (
+ traits => [qw(Getopt)],
cmd_aliases => 'r',
isa => Bool,
is => 'ro',
);
has restart_directory => (
+ traits => [qw(Getopt)],
cmd_aliases => 'rdir',
isa => ArrayRef[Str],
is => 'ro',
);
has restart_delay => (
+ traits => [qw(Getopt)],
cmd_aliases => 'rdel',
isa => Int,
is => 'ro',
my $restarter = $subclass->new(
%args,
- start_sub => sub { $self->_run },
- argv => \$self->ARGV,
+ start_sub => sub { $self->_run_application },
+ argv => $self->ARGV,
);
$restarter->run_and_watch;
sub _application_args {
my ($self) = shift;
return (
- $self->listen,
+ $self->port,
$self->host,
{
map { $_ => $self->$_ } qw/
=head1 NAME
-[% appprefix %]_server.pl - Catalyst Testserver
+Catalyst::Script::Server - Catalyst test server
=head1 SYNOPSIS
-[% appprefix %]_server.pl [options]
+ myapp_server.pl [options]
Options:
-d --debug force debug mode
=head1 DESCRIPTION
-Run a Catalyst Testserver for this application.
+Run a Catalyst test server for this application.
=head1 AUTHORS