[Catalyst] Questions If You Please
diment at gmail.com
Sat Mar 3 00:21:29 GMT 2012
It's difficult to answer this without more details on your use case, but here goes.
On 03/03/2012, at 7:50 AM, James D Bearden wrote:
> Hello All,
> My definitive guide to Catalyst should arrive on my doorstep shortly,
> but until then if somebody could answer a few questions for me it would
> be greatly appreciated:
> 2) I am evaluating catalyst to replace our current perl server written
> from scratch. By that I mean we wrote a lot of code in order to
> implement libraries that didn't exist on CPAN at the time.
> Our server code that is dedicated to talking to the client is a
> small subset of our total perl code. Therefore the "server" will be
> merely part of that greater code base, but the default catalyst
> structure seems to assume other code will fall underneath *it*. For
> example, with us the test scripts and static web content are checked
> into a separate spots, and a lot of our scripts expect stuff to be
> in a specific spot. My question is, how can I muck with the default
> catalyst directory structure? In other words, can I tweak
> myapp.psgi or something to define the lib, root, and test
> directories to be named something else and be somewhere else?
I'm not sure what you're trying to achieve here. Do you have dispatch stuff you want to preserve? If keep it separate during the porting process with clever web server configuration. Do you have non-cpan libraries that you want to use? use lib '/path/to/where/they/live' in MyApp.pm. Is there some more exotic use case that you haven't explained? Would it be solvable by Catalyst::Controller::WrapCGI or Catalyst::Controller::CGIBin, or could you look at Catalyst::Controller::MovableType and get some ideas from that?
Overriding the template location is usually done through configuration.
> 3) Also, the automatic restart of the developer server is a great
> feature I plan to have to do without because I can't figure out how
> to modify myapp_server.pl to let it know where I will have moved all
> the various bits to. So unless somebody can tell me how to do that I
> plan on just using plackup or starman for development, and
> restarting manually. Which is what we are used to doing right now.
I've never found the restarter terribly useful. Once you work out the structure of your app as per question 1 this should all come out in the wash though if you do find it useful.
> 4) Finally, our current system relies on a more or less stock SSL over
> TCP socket for secure transport. I already have the conversion from
> a TCP socket connection to stateless HTTP working with minimal
> impact to our current codebase, but not the SSL to HTTPS. I see
> there is a module to require a secure connection, but is there no
> module to actually provide the secure connection? In other words, to
> use HTTPS do I need to proxy through a web server because there is
> no way for something like starman to do that by itself? What is
> complicating matters is our client is a thick Java application, so
> if there is no way then I would rather just build in some sort of
> mechanism to disable HTTPS for development rather than set up a
> HTTPS capable development web server.
I think you would want some custom plack middleware for this.
> I also have a bajillion questions about deployment, but hopefully the
> book will shed some light on that. In case you are wondering, I am
> hoping to be able to use Catalyst because we plan to transition to a
> light client, and using Catalyst would make that less painful.
More information about the Catalyst