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)],
76 has app => ( isa => 'Str', is => 'ro', required => 1 ); # THIS IS FUCKING RETARDED HALP PLZ
78 traits => [qw(Getopt)],
85 has restart_delay => (
86 traits => [qw(Getopt)],
87 cmd_aliases => 'rdel',
93 has restart_regex => (
94 traits => [qw(Getopt)],
101 has follow_symlinks => (
102 traits => [qw(Getopt)],
103 cmd_aliases => 'sym',
114 pod2usage() if $self->help;
115 my $app = $self->app;
116 Class::MOP::load_class($app);
118 $self->listen, $self->host,
120 'fork' => $self->fork,
121 keepalive => $self->keepalive,
122 background => $self->background,
123 pidfile => $self->pidfile,
124 keepalive => $self->keepalive,
125 restart => $self->restart,
126 restart_delay => $self->restart_delay,
127 restart_regex => qr/$self->restart_regex/,
128 # FIXME restart_directory => $self->restart_directory,
129 follow_symlinks => $self->follow_symlinks,
140 [% appprefix %]_server.pl - Catalyst Testserver
144 [% appprefix %]_server.pl [options]
147 -d -debug force debug mode
148 -f -fork handle each request in a new process
150 -? -help display this help and exits
151 -host host (defaults to all)
152 -p -port port (defaults to 3000)
153 -k -keepalive enable keep-alive connections
154 -r -restart restart when files get modified
156 -rd -restartdelay delay between file checks
157 (ignored if you have Linux::Inotify2 installed)
158 -rr -restartregex regex match files that trigger
159 a restart when modified
160 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
161 -restartdirectory the directory to search for
162 modified files, can be set mulitple times
163 (defaults to '[SCRIPT_DIR]/..')
164 -follow_symlinks follow symlinks in search directories
165 (defaults to false. this is a no-op on Win32)
166 -background run the process in the background
167 -pidfile specify filename for pid file
170 perldoc Catalyst::Manual
171 perldoc Catalyst::Manual::Intro
175 Run a Catalyst Testserver for this application.
179 Catalyst Contributors, see Catalyst.pm
183 This library is free software. You can redistribute it and/or modify
184 it under the same terms as Perl itself.