[Catalyst] Serving static content

Andy Grundman andy at hybridized.org
Mon Jun 13 16:51:56 CEST 2005


samwyse wrote:
> That reminds me of a question.  Suppose that one intentionally wants
> different behavior for an app when running under Apache/mod_perl vs
> server.pl; for example, serving up static content.  What's the best
> way to determine the invocation method, and what's the best way to
> turn sections of code on and off?  Without testing, I'm imagining
> something like this:
> 
> if (defined $INC{Catalyst::Engine::HTTP}) {
>   require MyApp::Static;
>   import MyApp::Static;
> }

I did it this way in my RequireSSL plugin:

if ( $c->engine eq "Catalyst::Engine::HTTP" ) {
   ...
}

-Andy



More information about the Catalyst mailing list