Changeset 102 in bookmarks for trunk/start


Ignore:
Timestamp:
07/01/15 16:28:42 (9 years ago)
Author:
peter
Message:
  • allow a server_root key in the server config to set the root directory fdor the logs and pid file
  • updated the cpanfile to include more of the modules required for the web app to operate
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/start

    r96 r102  
    99use Plack::Runner; 
    1010use BookmarksApp; 
     11use File::Spec::Functions qw{catfile}; 
    1112 
    1213GetOptions( 
     
    1920my $app = BookmarksApp->new({ config => $config })->to_app; 
    2021 
    21 my $listen = ':' . ($config->{port} || 5000); 
     22my $server_root = $config->{server_root} || '.'; 
     23my $listen      = ':' . ($config->{port} || 5000); 
     24my $access_log  = catfile($server_root, 'access'); 
     25my $error_log   = catfile($server_root, 'errors'); 
     26my $pid_file    = catfile($server_root, 'pid'); 
    2227 
    2328my $runner = Plack::Runner->new(server => 'Starman'); 
    24 $runner->parse_options(qw{--listen}, $listen, qw{--daemonize --pid pid --error-log errors --access-log access}); 
     29$runner->parse_options( 
     30    '--daemonize', 
     31    '--listen',     $listen, 
     32    '--pid',        $pid_file, 
     33    '--error-log',  $error_log, 
     34    '--access-log', $access_log, 
     35); 
    2536$runner->run($app); 
Note: See TracChangeset for help on using the changeset viewer.