Merge branch 'psgi'
[catagits/Catalyst-Devel.git] / share / myapp.psgi.tt
CommitLineData
b769c101 1use strict;
2use warnings;
3
4use [% name %];
5use Plack::Middleware::Conditional;
6use Plack::Middleware::ReverseProxy;
7
a0e1d774 8my $app = [% name %]->psgi_app;
b769c101 9
10$app = Plack::Middleware::Conditional->wrap(
11 $app,
12 builder => sub { Plack::Middleware::ReverseProxy->wrap($_[0]) },
13 condition => sub {
14 my ($env) = @_;
15 return if [% name %]->config->{ignore_frontend_proxy};
16 return $env->{REMOTE_ADDR} eq '127.0.0.1'
17 || [% name %]->config->{using_frontend_proxy};
18 },
19);
20
21$app