From 62f28026e624ed30d620063a0fa92cbedb7f6673 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 10 Jan 2020 08:49:31 +0000 Subject: make Plack optional for non-WWW and non-httpd users Some users just want to run -mda, -watch, and/or -nntpd. Let them run just those without forcing them to pull in a bunch of dependencies. --- script/public-inbox-httpd | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'script/public-inbox-httpd') diff --git a/script/public-inbox-httpd b/script/public-inbox-httpd index b2464f4e..09da505e 100755 --- a/script/public-inbox-httpd +++ b/script/public-inbox-httpd @@ -1,15 +1,18 @@ #!/usr/bin/perl -w -# Copyright (C) 2016-2019 all contributors +# Copyright (C) 2016-2020 all contributors # License: AGPL-3.0+ # # Standalone HTTP server for public-inbox. use strict; -use warnings; -use Plack::Util; use PublicInbox::Daemon; -use PublicInbox::HTTP; -use PublicInbox::HTTPD; -use Plack::Builder; +BEGIN { + for (qw(Plack::Builder Plack::Util)) { + eval("require $_") or die "E: Plack is required for $0\n"; + } + Plack::Builder->import; + require PublicInbox::HTTP; + require PublicInbox::HTTPD; +} my %httpds; my $app; my $refresh = sub { -- cgit v1.2.3-24-ge0c7