[Dancer-users] setting confdir and environments problem

Al calyx2011 at gmail.com
Thu Apr 28 18:11:46 CEST 2011


On 28 April 2011 06:44, Ted Henry <tedhenry10 at gmail.com> wrote:
> I've been checking out Dancer and the flexibility of reorganizing the
> directory structure of an app is great; however, I'm not sure I'm
> doing it right for confdir.
>
> I have an app named Alpha-Beta. If I do
>
> $ export DANCER_CONFDIR=/Users/ted/tmp/tmp/Alpha-Beta/etc
> $ bin/app.pl
>
> then the file /Users/ted/tmp/tmp/Alpha-Beta/etc/config.yml is found
> but the file /Users/ted/tmp/tmp/Alpha-Beta/etc/environments/development.yml
> is not found.
>
> When I look in Dancer/Config.pm I see the following code
>
> sub environment_file {
>    my $env = setting('environment');
>    return path(setting('appdir'), 'environments', "$env.yml");
> }
>
> Should it be the following?
>
> sub environment_file {
>    my $env = setting('environment');
>    return path(setting('confdir') || setting('appdir'),
> 'environments', "$env.yml");
> }

DANCER_CONFDIR just defines where config.yml is located. In config.yml
you can specify your appdir:

appdir: "/Users/ted/tmp/tmp/Alpha-Beta/etc"

Then Dancer will find your environment files under [appdir]/environments/


More information about the Dancer-users mailing list