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';
19 traits => [qw(Getopt)],
27 has host => ( isa => 'Str', is => 'ro', required => 0, default => "localhost" );
28 has fork => ( isa => 'Bool', is => 'ro', required => 0 );
29 has listen => ( isa => 'Int', is => 'ro', required => 0, default => "3000" );
30 has pidfile => ( isa => 'Str', is => 'ro', required => 0 );
31 has keepalive => ( isa => 'Bool', is => 'ro', required => 0, default => 0 );
32 has background => ( isa => 'Bool', is => 'ro', required => 0 );
33 has app => ( isa => 'Str', is => 'ro', required => 1 );
34 has restart => ( isa => 'Bool', is => 'ro', required => 0 );
35 has restart_delay => ( isa => 'Int', is => 'ro', required => 0 );
36 has restart_regex => ( isa => 'Str', is => 'ro', required => 0 );
37 has follow_symlinks => ( isa => 'Bool', is => 'ro', required => 0 );
44 pod2usage() if $self->help;
46 Class::MOP::load_class($app);
48 $self->listen, $self->host,
50 'fork' => $self->fork,
51 keepalive => $self->keepalive,
52 background => $self->background,
53 pidfile => $self->pidfile,
54 keepalive => $self->keepalive,
55 restart => $self->restart,
56 restart_delay => $self->restart_delay,
57 restart_regex => qr/$self->restart_regex/,
58 # FIXME restart_directory => $self->restart_directory,
59 follow_symlinks => $self->follow_symlinks,
70 [% appprefix %]_server.pl - Catalyst Testserver
74 [% appprefix %]_server.pl [options]
77 -d -debug force debug mode
78 -f -fork handle each request in a new process
80 -? -help display this help and exits
81 -host host (defaults to all)
82 -p -port port (defaults to 3000)
83 -k -keepalive enable keep-alive connections
84 -r -restart restart when files get modified
86 -rd -restartdelay delay between file checks
87 (ignored if you have Linux::Inotify2 installed)
88 -rr -restartregex regex match files that trigger
89 a restart when modified
90 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
91 -restartdirectory the directory to search for
92 modified files, can be set mulitple times
93 (defaults to '[SCRIPT_DIR]/..')
94 -follow_symlinks follow symlinks in search directories
95 (defaults to false. this is a no-op on Win32)
96 -background run the process in the background
97 -pidfile specify filename for pid file
100 perldoc Catalyst::Manual
101 perldoc Catalyst::Manual::Intro
105 Run a Catalyst Testserver for this application.
109 Catalyst Contributors, see Catalyst.pm
113 This library is free software. You can redistribute it and/or modify
114 it under the same terms as Perl itself.