[Catalyst] Using URIs for my app in another program

Tomas Doran bobtfish at bobtfish.net
Sat Jun 7 02:40:22 BST 2008

On 7 Jun 2008, at 01:17, Byron Young wrote:
> Is there any way to fake a request when my app starts?  It seems  
> like a bit of a catch-22 -- I need to know a URL in order to fake  
> the request, but in order to generate the URL I need to have a  
> request...

The problem which you have here is that the application doesn't know  
what URLs it's attached to until run time.

Remember - you can have multiple virtual hosts pointing to the same  
application instance, therefore catalyst *can't* know in advance  
where it is going to be served from.

The simple perl HTTP engine which script/myapp_server.pl uses prints  
a nice message with the app URL - but that's because it's a toy  
compared to what you might do in real deployment.

> Am I doomed to storing the URL for my 'populate database with urls'  
> action in a config file and updating it by hand when I move the web  
> app?

I think so, but I think that you *want* to do this. Otherwise, how do  
you deal with testing the app? And also testing your thing which  
requests the app. Surely you're gonna want to be able to test against  
demo servers you've brought up on localhost?

I think that you're trying to solve the wrong problem here, sorry. To  
be honest - how often are you really going to move the webapp once  
it's deployed? What's wrong with giving it it's own DNS CNAME which  
you switch between boxen hosting it?


More information about the Catalyst mailing list