Add public/dispatch.cgi for use with Apache and Plack.
authorJason Stephenson <jason@sigio.com>
Fri, 27 Jun 2014 22:18:08 +0000 (18:18 -0400)
committerJason Stephenson <jason@sigio.com>
Mon, 21 Jul 2014 00:07:37 +0000 (20:07 -0400)
Signed-off-by: Jason Stephenson <jason@sigio.com>
public/dispatch.cgi [new file with mode: 0755]

diff --git a/public/dispatch.cgi b/public/dispatch.cgi
new file mode 100755 (executable)
index 0000000..d04253c
--- /dev/null
@@ -0,0 +1,15 @@
+#!/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', 'ncip_dancing.pl');
+die "Unable to read startup script: $psgi" unless -r $psgi;
+
+Plack::Runner->run($psgi);