1 package Catalyst::Script::Server;
8 use Catalyst::Engine::HTTP;
9 use namespace::clean -except => [ qw(meta) ];
11 with 'MooseX::Getopt';
13 has help => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } );
14 has host => ( isa => 'Str', is => 'ro', required => 0, default => sub { "localhost" } );
15 has fork => ( isa => 'Bool', is => 'ro', required => 0 );
16 has listen => ( isa => 'Int', is => 'ro', required => 0, default => sub{ 3000 } );
17 has pidfile => ( isa => 'Str', is => 'ro', required => 0 );
18 has keepalive => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } );
19 has background => ( isa => 'Bool', is => 'ro', required => 0 );
20 has app => ( isa => 'Str', is => 'ro', required => 1 );
21 has restart => ( isa => 'Bool', is => 'ro', required => 0 );
22 has restart_delay => ( isa => 'Int', is => 'ro', required => 0 );
23 has restart_regex => ( isa => 'Str', is => 'ro', required => 0 );
24 has follow_symlinks => ( isa => 'Bool', is => 'ro', required => 0 );
31 pod2usage() if $self->help;
33 Class::MOP::load_class($app);
35 $self->listen, $self->host,
37 'fork' => $self->fork,
38 keepalive => $self->keepalive,
39 background => $self->background,
40 pidfile => $self->pidfile,
41 keepalive => $self->keepalive,
42 restart => $self->restart,
43 restart_delay => $self->restart_delay,
44 restart_regex => qr/$self->restart_regex/,
45 # FIXME restart_directory => $self->restart_directory,
46 follow_symlinks => $self->follow_symlinks,