]> Sergey Matveev's repositories - public-inbox.git/blob - examples/public-inbox.psgi
examples/public-inbox.psgi: update with middlewares
[public-inbox.git] / examples / public-inbox.psgi
1 #!/usr/bin/perl -w
2 # Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
3 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-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 use strict;
7 use warnings;
8 use PublicInbox::WWW;
9 PublicInbox::WWW->preload;
10 use Plack::Request;
11 use Plack::Builder;
12 builder {
13         enable "Deflater",
14                 content_type => [ 'text/html', 'text/plain',
15                                 'application/atom+xml' ];
16         enable "Head";
17         sub {
18                 my $req = Plack::Request->new(@_);
19                 PublicInbox::WWW::run($req, $req->method);
20         }
21 }