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::clean -except => [ qw(meta) ];
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)],
77 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',
120 pod2usage() if $self->help;
121 my $app = $self->app;
122 Class::MOP::load_class($app);
124 $self->listen, $self->host,
126 'fork' => $self->fork,
127 keepalive => $self->keepalive,
128 background => $self->background,
129 pidfile => $self->pidfile,
130 keepalive => $self->keepalive,
131 restart => $self->restart,
132 restart_delay => $self->restart_delay,
133 restart_regex => qr/$self->restart_regex/,
134 # FIXME restart_directory => $self->restart_directory,
135 follow_symlinks => $self->follow_symlinks,
146 [% appprefix %]_server.pl - Catalyst Testserver
150 [% appprefix %]_server.pl [options]
153 -d --debug force debug mode
154 -f --fork handle each request in a new process
156 -h --help display this help and exits
157 --host host (defaults to all)
158 -p --port port (defaults to 3000)
159 -k --keepalive enable keep-alive connections
160 -r --restart restart when files get modified
162 --rd --restartdelay delay between file checks
163 (ignored if you have Linux::Inotify2 installed)
164 --rr --restartregex regex match files that trigger
165 a restart when modified
166 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
167 --rdir --restartdirectory the directory to search for
168 modified files, can be set mulitple times
169 (defaults to '[SCRIPT_DIR]/..')
170 --sym --follow_symlinks follow symlinks in search directories
171 (defaults to false. this is a no-op on Win32)
172 --bg --background run the process in the background
173 --pid --pidfile specify filename for pid file
176 perldoc Catalyst::Manual
177 perldoc Catalyst::Manual::Intro
181 Run a Catalyst Testserver for this application.
185 Catalyst Contributors, see Catalyst.pm
189 This library is free software. You can redistribute it and/or modify
190 it under the same terms as Perl itself.