diff options
Diffstat (limited to 'script/bookmarks_server.pl')
-rwxr-xr-x | script/bookmarks_server.pl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/script/bookmarks_server.pl b/script/bookmarks_server.pl index 1cc1e3c..adf777a 100755 --- a/script/bookmarks_server.pl +++ b/script/bookmarks_server.pl @@ -2,7 +2,7 @@ BEGIN { $ENV{CATALYST_ENGINE} ||= 'HTTP'; - $ENV{CATALYST_SCRIPT_GEN} = 11; + $ENV{CATALYST_SCRIPT_GEN} = 25; } use strict; @@ -16,6 +16,7 @@ my $fork = 0; my $help = 0; my $host = undef; my $port = 3000; +my $keepalive = 0; my $restart = 0; my $restart_delay = 1; my $restart_regex = '\.yml$|\.yaml$|\.pm$'; @@ -28,6 +29,7 @@ GetOptions( 'help|?' => \$help, 'host=s' => \$host, 'port=s' => \$port, + 'keepalive|k' => \$keepalive, 'restart|r' => \$restart, 'restartdelay|rd=s' => \$restart_delay, 'restartregex|rr=s' => \$restart_regex @@ -42,12 +44,15 @@ if ( $debug ) { $ENV{CATALYST_DEBUG} = 1; } +# This is require instead of use so that the above environment +# variables can be set at runtime. require Bookmarks; Bookmarks->run( $port, $host, { - argv => \@argv, - 'fork' => $fork, - restart => $restart, + argv => \@argv, + 'fork' => $fork, + keepalive => $keepalive, + restart => $restart, restart_delay => $restart_delay, restart_regex => qr/$restart_regex/ } ); @@ -69,6 +74,7 @@ bookmarks_server.pl [options] -? -help display this help and exits -host host (defaults to all) -p -port port (defaults to 3000) + -k -keepalive enable keep-alive connections -r -restart restart when files got modified (defaults to false) -rd -restartdelay delay between file checks |