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)],
31 default => "localhost"
35 traits => [qw(Getopt)],
43 traits => [qw(Getopt)],
52 traits => [qw(Getopt)],
60 traits => [qw(Getopt)],
69 traits => [qw(Getopt)],
76 has app => ( isa => 'Str', is => 'ro', required => 1 ); # THIS IS FUCKING RETARDED HALP PLZ
78 traits => [qw(Getopt)],
85 has restart_delay => (
86 traits => [qw(Getopt)],
87 cmd_aliases => 'rdel',
93 has restart_regex => (
94 traits => [qw(Getopt)],
101 has follow_symlinks => ( isa => 'Bool', is => 'ro', required => 0 );
108 pod2usage() if $self->help;
109 my $app = $self->app;
110 Class::MOP::load_class($app);
112 $self->listen, $self->host,
114 'fork' => $self->fork,
115 keepalive => $self->keepalive,
116 background => $self->background,
117 pidfile => $self->pidfile,
118 keepalive => $self->keepalive,
119 restart => $self->restart,
120 restart_delay => $self->restart_delay,
121 restart_regex => qr/$self->restart_regex/,
122 # FIXME restart_directory => $self->restart_directory,
123 follow_symlinks => $self->follow_symlinks,
134 [% appprefix %]_server.pl - Catalyst Testserver
138 [% appprefix %]_server.pl [options]
141 -d -debug force debug mode
142 -f -fork handle each request in a new process
144 -? -help display this help and exits
145 -host host (defaults to all)
146 -p -port port (defaults to 3000)
147 -k -keepalive enable keep-alive connections
148 -r -restart restart when files get modified
150 -rd -restartdelay delay between file checks
151 (ignored if you have Linux::Inotify2 installed)
152 -rr -restartregex regex match files that trigger
153 a restart when modified
154 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
155 -restartdirectory the directory to search for
156 modified files, can be set mulitple times
157 (defaults to '[SCRIPT_DIR]/..')
158 -follow_symlinks follow symlinks in search directories
159 (defaults to false. this is a no-op on Win32)
160 -background run the process in the background
161 -pidfile specify filename for pid file
164 perldoc Catalyst::Manual
165 perldoc Catalyst::Manual::Intro
169 Run a Catalyst Testserver for this application.
173 Catalyst Contributors, see Catalyst.pm
177 This library is free software. You can redistribute it and/or modify
178 it under the same terms as Perl itself.