dispatch.fcgi 489B

1234567891011121314151617
  1. #!/usr/bin/env perl
  2. use Dancer ':syntax';
  3. use FindBin '$RealBin';
  4. use Plack::Handler::FCGI;
  5. # For some reason Apache SetEnv directives dont propagate
  6. # correctly to the dispatchers, so forcing PSGI and env here
  7. # is safer.
  8. set apphandler => 'PSGI';
  9. set environment => 'production';
  10. my $psgi = path($RealBin, '..', 'bin', 'app.pl');
  11. my $app = do($psgi);
  12. die "Unable to read startup script: $@" if $@;
  13. my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1);
  14. $server->run($app);