in reply to Dancer2: Why is bundled 'lib/' required?

The whole point of PSGI is to get as far away from A-patch-y as possible. You might have a better time with starman behind a reverse proxy like haproxy, nginx, or varnishd. Principally, the "dance app" is just what's in bin/app.psgi or whatever you named it. Furthermore, there's nothing dependant about what's in ../lib than what you have yourself coded. E.g., app.psgi doesn't have to have any external dependencies other that the code Dancer module.

If you look in bin/app.psgi generated by your referenced document, you will note:

#!/usr/bin/perl use strict; use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; # use this block if you don't need middleware, and only have a single +target Dancer app to run here use Dancr2; Dancr2->to_app;
So the line, use lib "$FindBin::Bin/../lib"; is the answer to your question. So you would want to replace that to ensure that the right path is in @INC. But if you can help it, get off the Apache plantation pronto. If it's getting invoked by Apache "as is", who the heck knows what the is going to translate into.

And I imagine Dancer2 does care that views, public, etc are next to whatever lib you use to to_app. The initial use lib ... line just gets to the module that has the use Dancer2; line and defines the handlers. So YMMV.

Replies are listed 'Best First'.
Re^2: Dancer2: Why is bundled 'lib/' required?
by Anonymous Monk on Feb 04, 2022 at 14:04 UTC
    The OP read you should
      English, Francis. English.
        You misspelled Français. X-D