2 # Copyright (C) 2014-2018 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
9 use Plack::Handler::CGI;
11 BEGIN { PublicInbox::WWW->preload if $ENV{MOD_PERL} }
12 my $www = PublicInbox::WWW->new;
13 my $have_deflater = eval { require Plack::Middleware::Deflater; 1 };
17 content_type => [ 'text/html', 'text/plain',
18 'application/atom+xml' ];
21 # Enable to ensure redirects and Atom feed URLs are generated
22 # properly when running behind a reverse proxy server which
23 # sets the X-Forwarded-Proto request header.
24 # See Plack::Middleware::ReverseProxy documentation for details
25 # enable 'ReverseProxy';
28 sub { $www->call(@_) };
30 Plack::Handler::CGI->new->run($app);