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)],
31 default => "localhost"
35 traits => [qw(Getopt)],
43 traits => [qw(Getopt)],
52 traits => [qw(Getopt)],
60 traits => [qw(Getopt)],
69 traits => [qw(Getopt)],
79 traits => [qw(NoGetopt)],
85 traits => [qw(Getopt)],
92 has restart_delay => (
93 traits => [qw(Getopt)],
94 cmd_aliases => 'rdel',
100 has restart_regex => (
101 traits => [qw(Getopt)],
102 cmd_aliases => 'rxp',
108 has follow_symlinks => (
109 traits => [qw(Getopt)],
110 cmd_aliases => 'sym',
121 pod2usage() if $self->help;
122 my $app = $self->app;
124 Class::MOP::load_class($app);
126 $self->listen, $self->host,
128 'fork' => $self->fork,
129 keepalive => $self->keepalive,
130 background => $self->background,
131 pidfile => $self->pidfile,
132 keepalive => $self->keepalive,
133 restart => $self->restart,
134 restart_delay => $self->restart_delay,
135 restart_regex => qr/$self->restart_regex/,
136 # FIXME restart_directory => $self->restart_directory,
137 follow_symlinks => $self->follow_symlinks,
148 [% appprefix %]_server.pl - Catalyst Testserver
152 [% appprefix %]_server.pl [options]
155 -d --debug force debug mode
156 -f --fork handle each request in a new process
158 -h --help display this help and exits
159 --host host (defaults to all)
160 -p --port port (defaults to 3000)
161 -k --keepalive enable keep-alive connections
162 -r --restart restart when files get modified
164 --rd --restartdelay delay between file checks
165 (ignored if you have Linux::Inotify2 installed)
166 --rr --restartregex regex match files that trigger
167 a restart when modified
168 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
169 --rdir --restartdirectory the directory to search for
170 modified files, can be set mulitple times
171 (defaults to '[SCRIPT_DIR]/..')
172 --sym --follow_symlinks follow symlinks in search directories
173 (defaults to false. this is a no-op on Win32)
174 --bg --background run the process in the background
175 --pid --pidfile specify filename for pid file
178 perldoc Catalyst::Manual
179 perldoc Catalyst::Manual::Intro
183 Run a Catalyst Testserver for this application.
187 Catalyst Contributors, see Catalyst.pm
191 This library is free software. You can redistribute it and/or modify
192 it under the same terms as Perl itself.