1 package Catalyst::Script::Server;
4 $ENV{CATALYST_ENGINE} ||= 'HTTP';
5 $ENV{CATALYST_SCRIPT_GEN} = 31;
6 require Catalyst::Engine::HTTP;
10 use lib "$Bin/../lib";
13 use Catalyst::Engine::HTTP;
14 use namespace::clean -except => [ qw(meta) ];
16 with 'MooseX::Getopt';
18 has help => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } );
19 has host => ( isa => 'Str', is => 'ro', required => 0, default => sub { "localhost" } );
20 has fork => ( isa => 'Bool', is => 'ro', required => 0 );
21 has listen => ( isa => 'Int', is => 'ro', required => 0, default => sub{ 3000 } );
22 has pidfile => ( isa => 'Str', is => 'ro', required => 0 );
23 has keepalive => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } );
24 has background => ( isa => 'Bool', is => 'ro', required => 0 );
25 has app => ( isa => 'Str', is => 'ro', required => 1 );
26 has restart => ( isa => 'Bool', is => 'ro', required => 0 );
27 has restart_delay => ( isa => 'Int', is => 'ro', required => 0 );
28 has restart_regex => ( isa => 'Str', is => 'ro', required => 0 );
29 has follow_symlinks => ( isa => 'Bool', is => 'ro', required => 0 );
36 pod2usage() if $self->help;
38 Class::MOP::load_class($app);
40 $self->listen, $self->host,
42 'fork' => $self->fork,
43 keepalive => $self->keepalive,
44 background => $self->background,
45 pidfile => $self->pidfile,
46 keepalive => $self->keepalive,
47 restart => $self->restart,
48 restart_delay => $self->restart_delay,
49 restart_regex => qr/$self->restart_regex/,
50 # FIXME restart_directory => $self->restart_directory,
51 follow_symlinks => $self->follow_symlinks,