From b30bc98b0296dae835bbdfce727239fd644972e2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 12 Dec 2015 04:15:48 +0000 Subject: repobrowse: log + commit viewing working for git Basically stealing URLs and parameters from cgit as much as we can. This could get get interesting... --- examples/repo-browse.psgi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/repo-browse.psgi (limited to 'examples') diff --git a/examples/repo-browse.psgi b/examples/repo-browse.psgi new file mode 100644 index 00000000..b02b8e8b --- /dev/null +++ b/examples/repo-browse.psgi @@ -0,0 +1,25 @@ +#!/usr/bin/perl -w +# Copyright (C) 2015 all contributors +# License: AGPL-3.0+ +# 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::RepoBrowse; +use Plack::Request; +use Plack::Builder; +my $have_deflater = eval { require Plack::Middleware::Deflater; 1 }; +my $repo_browse = PublicInbox::RepoBrowse->new; + +builder { + if ($have_deflater) { + enable 'Deflater', + content_type => [ 'text/html', 'text/plain', + 'application/atom+xml' ]; + } + enable 'Head'; + sub { + my $req = Plack::Request->new(@_); + $repo_browse->run($req, $req->method); + } +} -- cgit v1.2.3-24-ge0c7