2 # Copyright (C) 2014-2016 all contributors <meta@public-inbox.org>
3 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
4 # Note: this is part of our test suite, update t/plack.t if this changes
5 # Usage: plackup [OPTIONS] /path/to/this/file
6 # A startup command for development which monitors changes:
7 # plackup -I lib -o 127.0.0.1 -R lib -r examples/public-inbox.psgi
11 PublicInbox::WWW->preload;
13 my $www = PublicInbox::WWW->new;
24 "Plack::Middleware::Deflater missing, bandwidth will be wasted\n";
26 # Enable to ensure redirects and Atom feed URLs are generated
27 # properly when running behind a reverse proxy server which
28 # sets X-Forwarded-For and X-Forwarded-Proto request headers.
29 # See Plack::Middleware::ReverseProxy documentation for details
30 eval { enable 'ReverseProxy' };
32 "Plack::Middleware::ReverseProxy missing,\n",
33 "URL generation for redirects may be wrong if behind a reverse proxy\n";
35 # Optional: Log timing information for requests to track performance.
36 # Logging to STDOUT is recommended since public-inbox-httpd knows
37 # how to reopen it via SIGUSR1 after log rotation.
38 # enable 'AccessLog::Timed',
39 # logger => sub { syswrite(STDOUT, $_[0]) },
40 # format => '%t "%r" %>s %b %D';
43 sub { $www->call(@_) };