X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=examples%2Fpublic-inbox.psgi;h=1de5bb7daec73120aa1502905dd2559b2c6cbb26;hb=f76f265a851944b5dedcc3be5f3b5224b6ebda89;hp=8eb67eb182fb01641565dd0932258760709b366c;hpb=dd4f0e17f40a9d77c48bb0e868efdc744401dc0c;p=public-inbox.git diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi index 8eb67eb1..1de5bb7d 100644 --- a/examples/public-inbox.psgi +++ b/examples/public-inbox.psgi @@ -1,13 +1,21 @@ #!/usr/bin/perl -w -# Copyright (C) 2014, Eric Wong and all contributors +# Copyright (C) 2014-2015 all contributors # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt) # Note: this is part of our test suite, update t/plack.t if this changes # Usage: plackup [OPTIONS] /path/to/this/file use strict; use warnings; -require PublicInbox::WWW; -require Plack::Request; -sub { - my $req = Plack::Request->new(@_); - PublicInbox::WWW::run($req, $req->method); -}; +use PublicInbox::WWW; +PublicInbox::WWW->preload; +use Plack::Request; +use Plack::Builder; +builder { + enable "Deflater", + content_type => [ 'text/html', 'text/plain', + 'application/atom+xml' ]; + enable "Head"; + sub { + my $req = Plack::Request->new(@_); + PublicInbox::WWW::run($req, $req->method); + } +}