[dancer-users] Mig Dancer 1 to 2: set confdir does not work?

Jochen Schnuerle js at betabox.de
Wed May 25 08:49:52 BST 2016


Stefan Hornburg (Racke) wrote:
> On 05/24/2016 05:50 PM, Warren Young wrote:
>> On May 24, 2016, at 7:50 AM, Jochen Schnuerle<js at betabox.de>  wrote:
>>> But I don't unterstand.
>> I pointed you right at the code implementing the feature you’re trying to use.  It’s quite straightforward Perl.  If you don’t understand my prose description of what it does, you should certainly understand the Perl code.
>>> I just want to move my config.yml in the sub dir /etc.
>> The feature you’re trying to use doesn’t allow that.  You will either have to structure your project directory differently, or change Dancer to behave the way you prefer.
> I suggest to look at the environment variables, which Dancer 2 uses:
> https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Config.pod#Environment-variables
> Regards
>          Racke
That worked great!

After configure the env vars:

export DANCER_CONFDIR="/opt/fsi/portal/etc"
export DANCER_ENVDIR="/opt/fsi/portal/etc"

Dancer2 search for the "views" dir in


So I add to the config.yml of my Dancer2 source:

views: "/opt/fsi/portal/views"

and remove the source lines in my fsi.pm:

#set config_location        => $dirs . '../etc';
#set environments_location  => $dirs . '../etc';
#set 'environment' => 'development';

and all works great, like I have it in my Dancer1 source/tree.

Thank you very much!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160525/6548b276/attachment.html>

More information about the dancer-users mailing list