share/skel/tutorial/public/dispatch.cgi
raw| 1 | #!/usr/bin/env perl |
| 2 | BEGIN { $ENV{DANCER_APPHANDLER} = 'PSGI';} |
| 3 | use Dancer2; |
| 4 | use FindBin '$RealBin'; |
| 5 | use Plack::Runner; |
| 6 | |
| 7 | # For some reason Apache SetEnv directives don't propagate |
| 8 | # correctly to the dispatchers, so forcing PSGI and env here |
| 9 | # is safer. |
| 10 | set apphandler => 'PSGI'; |
| 11 | set environment => 'production'; |
| 12 | |
| 13 | my $psgi = path($RealBin, '..', 'bin', 'app.psgi'); |
| 14 | die "Unable to read startup script: $psgi" unless -r $psgi; |
| 15 | |
| 16 | Plack::Runner->run($psgi); |