From 79bf257cbc4e188992f540d6b4ae1bd5cbcf26ee Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 1 Jul 2016 01:03:31 +0000 Subject: update git repo location to https:// using GitHTTPBackend.pm Might as well eat our own dogfood... --- examples/public-inbox.psgi | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'examples/public-inbox.psgi') diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi index 4edbf5e3..a90a2bc3 100644 --- a/examples/public-inbox.psgi +++ b/examples/public-inbox.psgi @@ -11,6 +11,10 @@ use PublicInbox::WWW; PublicInbox::WWW->preload; use Plack::Builder; my $www = PublicInbox::WWW->new; + +# share the public-inbox code itself: +my $src = $ENV{SRC_GIT_DIR}; # '/path/to/public-inbox.git' + builder { eval { enable 'Deflater', @@ -40,5 +44,13 @@ builder { # format => '%t "%r" %>s %b %D'; enable 'Head'; - sub { $www->call(@_) }; + sub { + my ($env) = @_; + # share public-inbox.git code! + if ($src && $env->{PATH_INFO} =~ m!\A/public-inbox\.git/(.*)!) { + PublicInbox::GitHTTPBackend::serve($env, $src, $1); + } else { + $www->call($env); + } + }; } -- cgit v1.2.3-24-ge0c7