user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/3] examples/public-inbox.psgi: update with middlewares
@ 2015-09-03  8:32  7% Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2015-09-03  8:32 UTC (permalink / raw)
  To: meta

HTML, text, and probably Atom feeds should be compressed.
---
 examples/public-inbox.psgi | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi
index 8eb67eb..04f3329 100644
--- a/examples/public-inbox.psgi
+++ b/examples/public-inbox.psgi
@@ -5,9 +5,17 @@
 # Usage: plackup [OPTIONS] /path/to/this/file
 use strict;
 use warnings;
-require PublicInbox::WWW;
-require Plack::Request;
-sub {
-	my $req = Plack::Request->new(@_);
-	PublicInbox::WWW::run($req, $req->method);
-};
+use PublicInbox::WWW;
+PublicInbox::WWW->preload;
+use Plack::Request;
+use Plack::Builder;
+builder {
+	enable "Deflater",
+		content_type => [ 'text/html', 'text/plain',
+				'application/atom+xml' ];
+	enable "Head";
+	sub {
+		my $req = Plack::Request->new(@_);
+		PublicInbox::WWW::run($req, $req->method);
+	}
+}
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-03  8:32  7% [PATCH 1/3] examples/public-inbox.psgi: update with middlewares Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).