paperlined.org
apps > dancer
document updated 13 years ago, on Sep 14, 2011
Various ways to deploy Dancer.

CGI-BIN script

Method 1

The dancer helper script will create the file public/dispatch.cgi. That can be run in an Apache cgi-bin/ directory. That helper script contains:
#!/usr/bin/env perl
use Dancer ':syntax';
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');
die "Unable to read startup script: $psgi" unless -r $psgi;

Plack::Runner->run($psgi);