- Timestamp:
- 06/06/15 00:17:55 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/start
r93 r94 5 5 use lib "$FindBin::RealBin/lib"; 6 6 7 use Getopt::Long; 8 use YAML; 7 9 use Plack::Runner; 8 10 use BookmarksApp; 9 11 10 my $CONFIG_FILE = shift || 'conf.yml'; 11 my $app = BookmarksApp->new({ config_file => $CONFIG_FILE })->to_app; 12 GetOptions( 13 'file=s' => \my $CONFIG_FILE, 14 ); 15 16 $CONFIG_FILE ||= 'conf.yml'; 17 -e $CONFIG_FILE or die "Config file $CONFIG_FILE not found\n"; 18 my $config = YAML::LoadFile($CONFIG_FILE); 19 my $app = BookmarksApp->new({ config => $config })->to_app; 20 21 my $listen = ':' . ($config->{port} || 5000); 12 22 13 23 my $runner = Plack::Runner->new(server => 'Starman'); 14 $runner->parse_options(qw{--listen :5000--daemonize --pid pid --error-log errors --access-log access});24 $runner->parse_options(qw{--listen}, $listen, qw{--daemonize --pid pid --error-log errors --access-log access}); 15 25 $runner->run($app);
Note: See TracChangeset
for help on using the changeset viewer.