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::autoclean;
16 with 'MooseX::Getopt';
19 traits => [qw(Getopt)],
24 -d --debug force debug mode
30 traits => [qw(Getopt)],
35 -h --help display this help and exits
43 default => "localhost"
47 traits => [qw(Getopt)],
55 traits => [qw(Getopt)],
64 traits => [qw(Getopt)],
72 traits => [qw(Getopt)],
81 traits => [qw(Getopt)],
91 traits => [qw(NoGetopt)],
97 traits => [qw(Getopt)],
104 has restart_delay => (
105 traits => [qw(Getopt)],
106 cmd_aliases => 'rdel',
112 has restart_regex => (
113 traits => [qw(Getopt)],
114 cmd_aliases => 'rxp',
120 has follow_symlinks => (
121 traits => [qw(Getopt)],
122 cmd_aliases => 'sym',
140 $self->usage if $self->help;
141 my $app = $self->app;
142 Class::MOP::load_class($app);
144 $self->listen, $self->host,
146 'fork' => $self->fork,
147 keepalive => $self->keepalive,
148 background => $self->background,
149 pidfile => $self->pidfile,
150 keepalive => $self->keepalive,
151 restart => $self->restart,
152 restart_delay => $self->restart_delay,
153 restart_regex => qr/$self->restart_regex/,
154 # FIXME restart_directory => $self->restart_directory,
155 follow_symlinks => $self->follow_symlinks,
162 __PACKAGE__->meta->make_immutable;
168 [% appprefix %]_server.pl - Catalyst Testserver
172 [% appprefix %]_server.pl [options]
175 -d --debug force debug mode
176 -f --fork handle each request in a new process
178 -h --help display this help and exits
179 --host host (defaults to all)
180 -p --port port (defaults to 3000)
181 -k --keepalive enable keep-alive connections
182 -r --restart restart when files get modified
184 --rd --restartdelay delay between file checks
185 (ignored if you have Linux::Inotify2 installed)
186 --rr --restartregex regex match files that trigger
187 a restart when modified
188 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
189 --rdir --restartdirectory the directory to search for
190 modified files, can be set mulitple times
191 (defaults to '[SCRIPT_DIR]/..')
192 --sym --follow_symlinks follow symlinks in search directories
193 (defaults to false. this is a no-op on Win32)
194 --bg --background run the process in the background
195 --pid --pidfile specify filename for pid file
198 perldoc Catalyst::Manual
199 perldoc Catalyst::Manual::Intro
203 Run a Catalyst Testserver for this application.
207 Catalyst Contributors, see Catalyst.pm
211 This library is free software. You can redistribute it and/or modify
212 it under the same terms as Perl itself.