]> git.sesse.net Git - remoteglot/blob - www/app.psgi
Add the Varnish configuration we are currently using (stripped of everything irrelevant).
[remoteglot] / www / app.psgi
1 #! /usr/bin/perl -T
2
3 use strict;
4 use warnings;
5 use lib qw(./include);
6
7 # These need to come before the Billig modules, so that exit is properly redirected.
8 use CGI::PSGI;
9 use CGI::Emulate::PSGI;
10 use CGI::Compile;
11
12 use Plack::Request;
13
14 # Older versions of File::pushd (used by CGI::Compile) have a performance trap
15 # that's hard to pin down. Warn about it.
16 use File::pushd;
17 if ($File::pushd::VERSION < 1.005) {
18         print STDERR "WARNING: You are using a version of File::pushd older than 1.005. This will work, but it has performance implications.\n";
19         print STDERR "Do not run in production!\n\n";
20 }
21
22 my $cgi = CGI::Compile->compile('/srv/analysis.sesse.net/www/analysis.pl');
23 my $handler = CGI::Emulate::PSGI->handler($cgi);
24
25 sub {
26         my $env = shift;
27         return &$handler($env);
28 }