]> Sergey Matveev's repositories - public-inbox.git/blob - examples/cgit.psgi
run update-copyrights from gnulib for 2019
[public-inbox.git] / examples / cgit.psgi
1 #!/usr/bin/perl -w
2 # Copyright (C) 2019 all contributors <meta@public-inbox.org>
3 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
4 #
5 # PublicInbox::Cgit may be used independently of WWW.
6 #
7 # Usage:
8 #       plackup -I lib -o 127.0.0.1 -R lib -r examples/cgit.psgi
9 use strict;
10 use warnings;
11 use Plack::Builder;
12 use PublicInbox::Cgit;
13 use PublicInbox::Config;
14 my $pi_config = PublicInbox::Config->new;
15 my $cgit = PublicInbox::Cgit->new($pi_config);
16
17 builder {
18         eval {
19                 enable 'Deflater',
20                         content_type => [ qw(
21                                 text/html
22                                 text/plain
23                                 application/atom+xml
24                                 )]
25         };
26         eval { enable 'ReverseProxy' };
27         enable 'Head';
28         sub { $cgit->call($_[0]) }
29 }