in reply to Combine Multiple Catalyst Applications

Helpful reading–

# If you're not reasonably up to date- sudo cpanm Plack Catalyst Catalyst::Devel

Full steps for testing two Cat apps in one server

# *nix centric. mkdir cattest cd cattest catalyst.pl OneFish catalyst.pl TwoFish vi^W emacs a-one-an-a-two-a.psgi # But I keed!

a-one-an-a-two-a.psgi

#!/usr/bin/env perl use strict; use Plack::Builder; use FindBin; use lib "$FindBin::Bin/OneFish/lib", "$FindBin::Bin/TwoFish/lib"; use OneFish; use TwoFish; my $app = builder { mount "/two" => TwoFish->psgi_app(@_); mount "/" => OneFish->psgi_app(@_); # Root needs to be last or it'll eat others. };

Run, dog, run

env CATALYST_DEBUG=0 plackup a-one-an-a-two-a.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/

Visit http://localhost:5000/ (or whatever name/ip your box prefers) and http://localhost:5000/two/ and don't forget to tip your servers.

Caveat: this might lead to entangling or making cross-dependent coding choices which would be bad. Make an effort to keep things compartimental. Abstract and separate commonality like sessions/auth. If each app can't run alone after you're done, you might as well have rolled them all into one to start.

Replies are listed 'Best First'.
Re^2: Combine Multiple Catalyst Applications
by temporal (Pilgrim) on Apr 13, 2012 at 22:03 UTC

    Thanks! Exactly what I was looking for (and entertaining to boot). I was peripherally aware of Plack. Now I have become FULLY aware. O_O

    Very handy.

      Get to know Plack . . . very, very, very well.
Re^2: Combine Multiple Catalyst Applications
by srchulo (Sexton) on May 09, 2014 at 03:31 UTC

    Is there a way to mount by domain name instead of path? I have multiple apps that I need to differentiate by which domain name is requesting them.

      Pretty sure there is; with a middleware mapper. Why don’t you post a new question/thread though so it’s not stuck down here?

        Thanks for the suggestion. I'll do that!