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