4 $ENV{CATALYST_ENGINE} ||= 'HTTP';
5 $ENV{CATALYST_SCRIPT_GEN} = 39;
6 require Catalyst::Engine::HTTP;
14 use lib "$FindBin::Bin/../lib";
20 my $port = $ENV{GITALIST_PORT} || $ENV{CATALYST_PORT} || 3000;
22 my $restart = $ENV{GITALIST_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
39 'keepalive|k' => \$keepalive,
40 'restart|r' => \$restart,
41 'restartdelay|rd=s' => \$check_interval,
42 'restartregex|rr=s' => \$file_regex,
43 'restartdirectory=s@' => \$watch_directory,
44 'followsymlinks' => \$follow_symlinks,
45 'background' => \$background,
46 'pidfile=s' => \$pidfile,
49 pod2usage(1) if $help;
52 $ENV{CATALYST_DEBUG} = 1;
55 # If we load this here, then in the case of a restarter, it does not
56 # need to be reloaded for each restart.
59 # If this isn't done, then the Catalyst::Devel tests for the restarter
61 $| = 1 if $ENV{HARNESS_ACTIVE};
64 # This is require instead of use so that the above environment
65 # variables can be set at runtime.
73 keepalive => $keepalive,
74 background => $background,
81 die "Cannot run in the background and also watch for changed files.\n"
84 require Catalyst::Restarter;
86 my $subclass = Catalyst::Restarter->pick_subclass;
89 $args{follow_symlinks} = 1
91 $args{directories} = $watch_directory
92 if defined $watch_directory;
93 $args{sleep_interval} = $check_interval
94 if defined $check_interval;
95 $args{filter} = qr/$file_regex/
96 if defined $file_regex;
98 my $restarter = $subclass->new(
100 start_sub => $runner,
104 $restarter->run_and_watch;
114 gitalist_server.pl - Catalyst Testserver
118 gitalist_server.pl [options]
121 -d -debug force debug mode
122 -f -fork handle each request in a new process
124 -? -help display this help and exits
125 -host host (defaults to all)
126 -p -port port (defaults to 3000)
127 -k -keepalive enable keep-alive connections
128 -r -restart restart when files get modified
130 -rd -restartdelay delay between file checks
131 (ignored if you have Linux::Inotify2 installed)
132 -rr -restartregex regex match files that trigger
133 a restart when modified
134 (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
135 -restartdirectory the directory to search for
136 modified files, can be set mulitple times
137 (defaults to '[SCRIPT_DIR]/..')
138 -follow_symlinks follow symlinks in search directories
139 (defaults to false. this is a no-op on Win32)
140 -background run the process in the background
141 -pidfile specify filename for pid file
144 perldoc Catalyst::Manual
145 perldoc Catalyst::Manual::Intro
149 Run a Catalyst Testserver for this application.
153 Catalyst Contributors, see Catalyst.pm
157 This library is free software. You can redistribute it and/or modify
158 it under the same terms as Perl itself.