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)],
30 default => "localhost"
34 traits => [qw(Getopt)],
42 traits => [qw(Getopt)],
51 traits => [qw(Getopt)],
59 traits => [qw(Getopt)],
68 traits => [qw(Getopt)],
78 traits => [qw(NoGetopt)],
84 traits => [qw(Getopt)],
91 has restart_delay => (
92 traits => [qw(Getopt)],
93 cmd_aliases => 'rdel',
99 has restart_regex => (
100 traits => [qw(Getopt)],
101 cmd_aliases => 'rxp',
107 has follow_symlinks => (
108 traits => [qw(Getopt)],
109 cmd_aliases => 'sym',
127 $self->usage if $self->help;
128 my $app = $self->app;
129 Class::MOP::load_class($app);
131 $self->listen, $self->host,
133 'fork' => $self->fork,
134 keepalive => $self->keepalive,
135 background => $self->background,
136 pidfile => $self->pidfile,
137 keepalive => $self->keepalive,
138 restart => $self->restart,
139 restart_delay => $self->restart_delay,
140 restart_regex => qr/$self->restart_regex/,
141 # FIXME restart_directory => $self->restart_directory,
142 follow_symlinks => $self->follow_symlinks,
153 [% appprefix %]_server.pl - Catalyst Testserver
157 [% appprefix %]_server.pl [options]
160 -d --debug force debug mode
161 -f --fork handle each request in a new process
163 -h --help display this help and exits
164 --host host (defaults to all)
165 -p --port port (defaults to 3000)
166 -k --keepalive enable keep-alive connections
167 -r --restart restart when files get modified
169 --rd --restartdelay delay between file checks
170 (ignored if you have Linux::Inotify2 installed)
171 --rr --restartregex regex match files that trigger
172 a restart when modified
173 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
174 --rdir --restartdirectory the directory to search for
175 modified files, can be set mulitple times
176 (defaults to '[SCRIPT_DIR]/..')
177 --sym --follow_symlinks follow symlinks in search directories
178 (defaults to false. this is a no-op on Win32)
179 --bg --background run the process in the background
180 --pid --pidfile specify filename for pid file
183 perldoc Catalyst::Manual
184 perldoc Catalyst::Manual::Intro
188 Run a Catalyst Testserver for this application.
192 Catalyst Contributors, see Catalyst.pm
196 This library is free software. You can redistribute it and/or modify
197 it under the same terms as Perl itself.