What Pedro said works joining multiple apps in one. More info here. Thank you!
I have some issues with how each application locates resources. It seems that both are using the same paths for libraries or views.
Suppose the next structure:pathX|__app1|__app2cd pathXplackup -a app.psgi
Error while loading pathX/app.psgi: Can't locate App1.pm in @INC ....
plackup -I app1/lib -I app2/lib app.psgiHow can I establish different environments (and paths) for each app?.
Route exception: pathX/views/index.tt is not a regular file or reference...
Although this could be very useful, it's not the best solution when you want to keep one server with multiple and isolated apps (of different developers/teams).
Anyway, thank you!.2013/9/18 Pedro Melo <melo@simplicidade.org>Hi,On Tue, Sep 17, 2013 at 10:36 AM, Juan José 'Peco' San Martín <jsanmartin@gmail.com> wrote:
Now, I would like put both applications in just one server, so I adjusted the Apache config just adding the two Location sections.I have 2 different Dancer apps (app1 and app2). Each one working very well on different servers under Apache and Plack::Handler::Apache2.
If I use the first app, everything works, but when I try the second one, it seems that Dancer2 (with Plack::Handler::Apache2) still looks for the paths of the first app (so it fails because it can not find my app2 modules).
Example (how to reproduce the behaviour)0) Dancer 2.061) Adjust Apache config to add the Locations of the two apps# Apache location<Location /app1>PerlSetVar psgi_app /path/app1/bin/app.pl
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
</Location>PerlSetVar psgi_app /path/app2/bin/app.pl
<Location /app2>
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
</Location>2) Try app1 => it works!
3) Try app2 => fails with the next message: Error while loading /app2/app.pl: Can't locate App2.pm in @INC (@INC contains /path/app1/lib/ /usr/local....)Where App2 is the main module at (app2/lib/) called from app2/bin/app.pl after use Dancer2.Try this: create a merged.psgi file with this content:use Plack::Builder;use App1;use App2;builder {mount '/app1' => App1->dance;mount '/app2' => App2->dance;};And then use it on Apache with:<Location />PerlSetVar psgi_app /path/to/merged.psgi
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
</Location>I have not tested this, I don't have a mod_perl2 at hand anymore, but it should work.Bye,--
Pedro Melo
@pedromelo
http://www.simplicidade.org/
xmpp:melo@simplicidade.org
mailto:melo@simplicidade.org_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users