2 # Copyright (C) 2014-2016 all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ or later <https://www.gnu.org/licenses/agpl-3.0.txt>
5 # Enables using PublicInbox::WWW as a CGI script
11 use Plack::Handler::CGI;
13 BEGIN { PublicInbox::WWW->preload if $ENV{MOD_PERL} }
14 my $www = PublicInbox::WWW->new;
15 my $have_deflater = eval { require Plack::Middleware::Deflater; 1 };
19 content_type => [ 'text/html', 'text/plain',
20 'application/atom+xml' ];
23 # Enable to ensure redirects and Atom feed URLs are generated
24 # properly when running behind a reverse proxy server which
25 # sets X-Forwarded-For and X-Forwarded-Proto request headers.
26 # See Plack::Middleware::ReverseProxy documentation for details
27 # enable 'ReverseProxy';
30 sub { $www->call(@_) };
32 Plack::Handler::CGI->new->run($app);