Skip to content

Commit

Permalink
updating cgi and fcgi dispatch handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
xsawyerx committed Dec 16, 2010
1 parent 8c0a749 commit c288516
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions public/dispatch.cgi
@@ -1,5 +1,13 @@
#!/usr/bin/env perl
use Plack::Runner;
use Dancer ':syntax';
my $psgi = path(dirname(__FILE__), '..', 'PEG.pl');
use FindBin '$RealBin';
use Plack::Runner;

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

my $psgi = path($RealBin, '..', 'bin', 'app.pl');
Plack::Runner->run($psgi);
14 changes: 11 additions & 3 deletions public/dispatch.fcgi
@@ -1,8 +1,16 @@
#!/usr/bin/env perl
use Plack::Handler::FCGI;
use Dancer ':syntax';
use FindBin '$RealBin';
use Plack::Handler::FCGI;

my $psgi = path(dirname(__FILE__), '..', 'PEG.pl');
# For some reason Apache SetEnv directives dont propagate
# correctly to the dispatchers, so forcing PSGI and env here
# is safer.
set apphandler => 'PSGI';
set environment => 'production';

my $psgi = path($RealBin, '..', 'bin', 'app.pl');
my $app = do($psgi);
my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1);
my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1);

$server->run($app);

0 comments on commit c288516

Please sign in to comment.