4 $ENV{CATALYST_ENGINE} ||= 'HTTP';
5 $ENV{CATALYST_SCRIPT_GEN} = 31;
6 require Catalyst::Engine::HTTP;
14 use lib "$FindBin::Bin/../lib";
16 #Need to preload, otherwise the first hit is slow
17 use CGI qw/:standard/;
24 my $port = $ENV{NDWEB_PORT} || $ENV{CATALYST_PORT} || 3000;
26 my $restart = $ENV{NDWEB_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
27 my $restart_delay = 1;
28 my $restart_regex = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.pm)$';
29 my $restart_directory = undef;
30 my $follow_symlinks = 0;
40 'keepalive|k' => \$keepalive,
41 'restart|r' => \$restart,
42 'restartdelay|rd=s' => \$restart_delay,
43 'restartregex|rr=s' => \$restart_regex,
44 'restartdirectory=s@' => \$restart_directory,
45 'followsymlinks' => \$follow_symlinks,
48 pod2usage(1) if $help;
50 if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
51 $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
54 $ENV{CATALYST_DEBUG} = 1;
57 # This is require instead of use so that the above environment
58 # variables can be set at runtime.
61 NDWeb->run( $port, $host, {
64 keepalive => $keepalive,
66 restart_delay => $restart_delay,
67 restart_regex => qr/$restart_regex/,
68 restart_directory => $restart_directory,
69 follow_symlinks => $follow_symlinks,
76 ndweb_server.pl - Catalyst Testserver
80 ndweb_server.pl [options]
83 -d -debug force debug mode
84 -f -fork handle each request in a new process
86 -? -help display this help and exits
87 -host host (defaults to all)
88 -p -port port (defaults to 3000)
89 -k -keepalive enable keep-alive connections
90 -r -restart restart when files get modified
92 -rd -restartdelay delay between file checks
93 -rr -restartregex regex match files that trigger
94 a restart when modified
95 (defaults to '\.yml$|\.yaml$|\.pm$')
96 -restartdirectory the directory to search for
97 modified files, can be set mulitple times
98 (defaults to '[SCRIPT_DIR]/..')
99 -follow_symlinks follow symlinks in search directories
100 (defaults to false. this is a no-op on Win32)
102 perldoc Catalyst::Manual
103 perldoc Catalyst::Manual::Intro
107 Run a Catalyst Testserver for this application.
111 Sebastian Riedel, C<sri@oook.de>
112 Maintained by the Catalyst Core Team.
116 This library is free software, you can redistribute it and/or modify
117 it under the same terms as Perl itself.