4 $ENV{CATALYST_ENGINE} ||= 'HTTP';
5 $ENV{CATALYST_SCRIPT_GEN} = 31;
6 require Catalyst::Engine::HTTP;
14 use lib "$FindBin::Bin/../lib";
15 use lib "$FindBin::Bin/../../../lib";
21 my $port = $ENV{ESITEST_PORT} || $ENV{CATALYST_PORT} || 3000;
23 my $restart = $ENV{ESITEST_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
24 my $restart_delay = 1;
25 my $restart_regex = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.conf|\.pm)$';
26 my $restart_directory = undef;
27 my $follow_symlinks = 0;
37 'keepalive|k' => \$keepalive,
38 'restart|r' => \$restart,
39 'restartdelay|rd=s' => \$restart_delay,
40 'restartregex|rr=s' => \$restart_regex,
41 'restartdirectory=s@' => \$restart_directory,
42 'followsymlinks' => \$follow_symlinks,
45 pod2usage(1) if $help;
47 if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
48 $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
51 $ENV{CATALYST_DEBUG} = 1;
54 # This is require instead of use so that the above environment
55 # variables can be set at runtime.
58 ESITest->run( $port, $host, {
61 keepalive => $keepalive,
63 restart_delay => $restart_delay,
64 restart_regex => qr/$restart_regex/,
65 restart_directory => $restart_directory,
66 follow_symlinks => $follow_symlinks,
73 esitest_server.pl - Catalyst Testserver
77 esitest_server.pl [options]
80 -d -debug force debug mode
81 -f -fork handle each request in a new process
83 -? -help display this help and exits
84 -host host (defaults to all)
85 -p -port port (defaults to 3000)
86 -k -keepalive enable keep-alive connections
87 -r -restart restart when files get modified
89 -rd -restartdelay delay between file checks
90 -rr -restartregex regex match files that trigger
91 a restart when modified
92 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
93 -restartdirectory the directory to search for
94 modified files, can be set mulitple times
95 (defaults to '[SCRIPT_DIR]/..')
96 -follow_symlinks follow symlinks in search directories
97 (defaults to false. this is a no-op on Win32)
99 perldoc Catalyst::Manual
100 perldoc Catalyst::Manual::Intro
104 Run a Catalyst Testserver for this application.
108 Catalyst Contributors, see Catalyst.pm
112 This library is free software, you can redistribute it and/or modify
113 it under the same terms as Perl itself.