RSS Git Download  Clone
Raw Blame History
#!/usr/bin/env perl
BEGIN { 
	$ENV{DANCER_APPHANDLER}  = 'PSGI';
    $ENV{DANCER_ENVIRONMENT} = 'production'; # set environment => 'production' doesn't work
}

use lib '/home/raj/perl5/lib/perl5';
use Dancer2;
use FindBin '$RealBin';
use Plack::Handler::FCGI;

# For some reason Apache SetEnv directives don't propagate
# correctly to the dispatchers, so forcing PSGI and env here
# is safer.
set apphandler  => 'PSGI';
set environment => 'production'; # doesn't work

my $psgi = path($RealBin, '..', 'bin', 'app.psgi');
my $app = do($psgi);
die "Unable to read startup script: $@" if $@;
my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1);

$server->run($app);