]> Sergey Matveev's repositories - public-inbox.git/blob - examples/cgit.psgi
www: avoid warnings on YYYYMMDD-only t= query parameter
[public-inbox.git] / examples / cgit.psgi
1 #!/usr/bin/perl -w
2 # Copyright (C) 2019-2020 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 (development, with auto-reload):
8 #       plackup -I lib -o 127.0.0.1 -R lib -r examples/cgit.psgi
9 #
10 # Usage (production, with public-inbox-httpd(1)):
11 #       public-inbox-httpd [OPTIONS] /path/to/examples/cgit.psgi
12 use strict;
13 use warnings;
14 use Plack::Builder;
15 use PublicInbox::Cgit;
16 use PublicInbox::Config;
17 my $pi_config = PublicInbox::Config->new;
18 my $cgit = PublicInbox::Cgit->new($pi_config);
19
20 builder {
21         eval { enable 'ReverseProxy' };
22         enable 'Head';
23         sub { $cgit->call($_[0]) }
24 }