1 #!/usr/local/bin/perl -w
4 $ENV{CATALYST_ENGINE} ||= 'HTTP';
5 $ENV{CATALYST_SCRIPT_GEN} = 30;
6 require Catalyst::Engine::HTTP;
14 use lib "$FindBin::Bin/../lib";
20 my $port = $ENV{TESTAPP_PORT} || $ENV{CATALYST_PORT} || 3000;
22 my $restart = $ENV{TESTAPP_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
23 my $restart_delay = 1;
24 my $restart_regex = '\.yml$|\.yaml$|\.pm$';
25 my $restart_directory = undef;
35 'keepalive|k' => \$keepalive,
36 'restart|r' => \$restart,
37 'restartdelay|rd=s' => \$restart_delay,
38 'restartregex|rr=s' => \$restart_regex,
39 'restartdirectory=s' => \$restart_directory,
42 pod2usage(1) if $help;
44 if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
45 $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
48 $ENV{CATALYST_DEBUG} = 1;
51 # This is require instead of use so that the above environment
52 # variables can be set at runtime.
55 TestApp->run( $port, $host, {
58 keepalive => $keepalive,
60 restart_delay => $restart_delay,
61 restart_regex => qr/$restart_regex/,
62 restart_directory => $restart_directory,
69 testapp_server.pl - Catalyst Testserver
73 testapp_server.pl [options]
76 -d -debug force debug mode
77 -f -fork handle each request in a new process
79 -? -help display this help and exits
80 -host host (defaults to all)
81 -p -port port (defaults to 3000)
82 -k -keepalive enable keep-alive connections
83 -r -restart restart when files get modified
85 -rd -restartdelay delay between file checks
86 -rr -restartregex regex match files that trigger
87 a restart when modified
88 (defaults to '\.yml$|\.yaml$|\.pm$')
89 -restartdirectory the directory to search for
94 perldoc Catalyst::Manual
95 perldoc Catalyst::Manual::Intro
99 Run a Catalyst Testserver for this application.
103 Sebastian Riedel, C<sri@oook.de>
104 Maintained by the Catalyst Core Team.
108 This library is free software, you can redistribute it and/or modify
109 it under the same terms as Perl itself.