From 65ff86f333a1f8276943248efef7fa2a64afe9e3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 25 Feb 2016 03:10:51 +0000 Subject: www: make interface more OO This allows multiple instances the WWW app from running within the same process space --- public-inbox-httpd | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'public-inbox-httpd') diff --git a/public-inbox-httpd b/public-inbox-httpd index 6436bd7d..3635c9a7 100644 --- a/public-inbox-httpd +++ b/public-inbox-httpd @@ -24,6 +24,7 @@ my $refresh = sub { "$0 runs in /, command-line paths must be absolute\n"; } } else { + my $www = PublicInbox::WWW->new; $app = eval { my $deflate_types = eval { require Plack::Middleware::Deflater; @@ -37,11 +38,7 @@ my $refresh = sub { content_type => $deflate_types } enable 'Head'; - sub { - my $req = Plack::Request->new(@_); - PublicInbox::WWW::run($req, - $req->method); - }; + sub { $www->call(@_) }; }; }; } -- cgit v1.2.3-24-ge0c7