Dancer-Plugin-RPC
view release on metacpan or search on metacpan
example/bin/example.pl view on Meta::CPAN
#!/usr/bin/perl -w
use strict;
use Cwd qw(abs_path);
use Daemon::Control;
my $PORT = $ENV{APP_PORT} // 3000;
my $APP = $ENV{APP_NAME} // 'example';
my $APP_DIR = abs_path('..') . "/$APP";
# Fake the `carton exec -- ...` effect
$ENV{'PERL5LIB'} = "$APP_DIR/local/lib/perl5";
chdir $APP_DIR or die $!;
Daemon::Control->new(
{
name => $APP,
path => abs_path($0),
program => "$APP_DIR/local/bin/starman",
program_args => [
'-l', "0.0.0.0:$PORT",
'--workers', '2',
'bin/app.psgi'
],
pid_file => "$APP_DIR/$APP.pid",
stderr_file => "$APP_DIR/$APP.err",
stdout_file => "$APP_DIR/$APP.out",
fork => 1,
}
)->run;
( run in 1.132 second using v1.01-cache-2.11-cpan-e93a5daba3e )