about summary refs log tree commit homepage
path: root/examples/public-inbox.psgi
blob: 1de5bb7daec73120aa1502905dd2559b2c6cbb26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w
# Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
# 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;
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);
	}
}