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)],
81 traits => [qw(NoGetopt)],
88 traits => [qw(Getopt)],
95 has restart_delay => (
96 traits => [qw(Getopt)],
97 cmd_aliases => 'rdel',
103 has restart_regex => (
104 traits => [qw(Getopt)],
105 cmd_aliases => 'rxp',
111 has follow_symlinks => (
112 traits => [qw(Getopt)],
113 cmd_aliases => 'sym',
124 pod2usage() if $self->help;
125 my $app = $self->app;
127 Class::MOP::load_class($app);
129 $self->listen, $self->host,
131 'fork' => $self->fork,
132 keepalive => $self->keepalive,
133 background => $self->background,
134 pidfile => $self->pidfile,
135 keepalive => $self->keepalive,
136 restart => $self->restart,
137 restart_delay => $self->restart_delay,
138 restart_regex => qr/$self->restart_regex/,
139 # FIXME restart_directory => $self->restart_directory,
140 follow_symlinks => $self->follow_symlinks,
151 [% appprefix %]_server.pl - Catalyst Testserver
155 [% appprefix %]_server.pl [options]
158 -d --debug force debug mode
159 -f --fork handle each request in a new process
161 -h --help display this help and exits
162 --host host (defaults to all)
163 -p --port port (defaults to 3000)
164 -k --keepalive enable keep-alive connections
165 -r --restart restart when files get modified
167 --rd --restartdelay delay between file checks
168 (ignored if you have Linux::Inotify2 installed)
169 --rr --restartregex regex match files that trigger
170 a restart when modified
171 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
172 --rdir --restartdirectory the directory to search for
173 modified files, can be set mulitple times
174 (defaults to '[SCRIPT_DIR]/..')
175 --sym --follow_symlinks follow symlinks in search directories
176 (defaults to false. this is a no-op on Win32)
177 --bg --background run the process in the background
178 --pid --pidfile specify filename for pid file
181 perldoc Catalyst::Manual
182 perldoc Catalyst::Manual::Intro
186 Run a Catalyst Testserver for this application.
190 Catalyst Contributors, see Catalyst.pm
194 This library is free software. You can redistribute it and/or modify
195 it under the same terms as Perl itself.