From: Eric Wong Date: Fri, 26 Feb 2016 03:51:47 +0000 (+0000) Subject: httpd: avoid loading our WWW-specific code early X-Git-Tag: v1.0.0~704 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=f8629575e505828e8d19d430aea68699802bd820 httpd: avoid loading our WWW-specific code early We want this to be usable as a generic httpd for other Free Software projects, so do not force users to load our WWW code at compile-time. --- diff --git a/public-inbox-httpd b/public-inbox-httpd index 772333e8..b871e3de 100644 --- a/public-inbox-httpd +++ b/public-inbox-httpd @@ -8,13 +8,9 @@ use warnings; use Plack::Util; use PublicInbox::Daemon; use PublicInbox::HTTP; -use PublicInbox::WWW; use Plack::Request; use Plack::Builder; -PublicInbox::WWW->preload; -my $have_deflater = eval { require Plack::Middleware::Deflater; 1 }; my %httpds; -my $config; my $app; my $refresh = sub { if (@ARGV) { @@ -24,6 +20,8 @@ my $refresh = sub { "$0 runs in /, command-line paths must be absolute\n"; } } else { + require PublicInbox::WWW; + PublicInbox::WWW->preload; my $www = PublicInbox::WWW->new; $app = eval { my $deflate_types = eval {