Subject: | RE: :* modules |
Date: | Sun, 13 Jun 2010 23:04:54 +0200 |
To: | bug-Catalyst-Engine-PSGI [...] rt.cpan.org |
From: | "Christiaan Kras" <c.kras [...] pcc-online.net> |
Sorry that was a bad case of copy and paste from examples. In my test case I named it $app
-origineel bericht-
Onderwerp: Re: [rt.cpan.org #58362] Document how to enable Plack::Middleware::* modules
Van: "miyagawa@gmail.com via RT" <bug-Catalyst-Engine-PSGI@rt.cpan.org>
Datum: 13-06-2010 22:59
<URL: https://rt.cpan.org/Ticket/Display.html?id=58362 >
On Sun, Jun 13, 2010 at 1:46 PM, Christiaan Kras via RT
<bug-Catalyst-Engine-PSGI@rt.cpan.org> wrote:
Show quoted text
> Queue: Catalyst-Engine-PSGI
> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58362 >
>
> The best what I could come up with was something like this:
>
> # app.psgi
> use Foo;
> use Plack::Builder;
> Foo->setup_engine('PSGI');
> my $handler = sub { Foo->new->run(@_) };
>
> builder {
> enable_if { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' }
> "Plack::Middleware::ReverseProxy";
> $app;
> };
>
> But this didn't work at all for me, but that's probably because I'm in
> the wrong direction.
Because your app is named $handler and you're using a wrong variable
$app to build it.
use strict. and you'll catch mistakes like this easily.
--
Tatsuhiko Miyagawa