about summary refs log tree commit homepage
path: root/lib/PublicInbox/Syscall.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-02-21 12:17:44 +0000
committerEric Wong <e@80x24.org>2023-02-21 23:42:19 +0000
commit752af98576ae3e68a301e07f11f023f3bf941152 (patch)
tree16eb3836aac5469f7552702c36187876ede065cd /lib/PublicInbox/Syscall.pm
parent4ffad9b0a60f40ee9717e22000c233fcba30b30d (diff)
downloadpublic-inbox-752af98576ae3e68a301e07f11f023f3bf941152.tar.gz
Since PublicInbox::WWW already generates manifest.js.gz, I'm
using an alternate path with PublicInbox::WwwStatic to host the
manifest.js.gz for coderepos at an alternate location.  The
following snippet lets me host
https://yhbt.net/lore/pub/manifest.js.gz for mirrored git
repositories, while https://yhbt.net/lore/manifest.js.gz
(no `pub') remains for inbox mirroring.

==> sample.psgi <==
use PublicInbox::WWW;
use PublicInbox::WwwStatic;
my $www = PublicInbox::WWW->new; # use default PI_CONFIG
my $st = PublicInbox::WwwStatic->new(docroot => '/path/to/code');
my $www_cb = sub {
	my ($env) = @_;
	if ($env->{PATH_INFO} eq '/pub/manifest.js.gz') {
		local $env->{PATH_INFO} = '/manifest.js.gz';
		my $res = $st->call($env);
		return $res if $res->[0] != 404;
	}
	$www->call($env);
};
builder {
	enable 'ReverseProxy';
	enable 'Head';
	mount '/lore' => $www_cb;
}
Diffstat (limited to 'lib/PublicInbox/Syscall.pm')
0 files changed, 0 insertions, 0 deletions