<div dir="ltr">> Date: Thu, 23 Jul 2015 19:31:45 +0200<br>><br>> From: Sawyer X <<a href="mailto:xsawyerx@gmail.com">xsawyerx@gmail.com</a>><br>> I suggest not using Dancer2 for the config loading here. The config loading<br><div>> for Dancer2 really should be for the framework. Even though you can add<br>> configurations for the app, it seems like a very custom and advanced<br>> situation.<br>><br>> What I recommend is having a setup() method in your app that loads<br>> configuration files for the database handles. Then you call that setup and<br>> *then* call ->to_app.<br>><br>> Do you understand what I mean?<br><br></div><div>I believe so -- I had a look at your (SawyerX's) Act code (on github) and you've used setup in a similar way there.<br><br>Is it possible to use a setup() method to alter the contents of the 'config' variable? For example, I would like to be able to switch sessions on and off without having to remove the session engine settings from the config file. If it's not possible, it's not a problem -- I'll do things a different way.</div><div><br></div><div>Thanks!</div><div>Amelia.</div><div><br></div><div><div><br></div><div>> On Thu, Jul 23, 2015 at 12:48 AM, Amelia Ireland <<a href="mailto:aireland@lbl.gov">aireland@lbl.gov</a>> wrote:<br>><br>> > To answer my own question, the easiest thing is to use<br>> > app->load_config_file(...) and merge the settings into the app config.<br>> ><br>> ><br>> > On 22 July 2015 at 15:41, Amelia Ireland <<a href="mailto:aireland@lbl.gov">aireland@lbl.gov</a>> wrote:<br>> > ><br>> > >> Hello all,<br>> > >><br>> > >> Is there a recommended method for using multiple configuration files<br>> > for a<br>> > >> Dancer2 application in addition to the config.xxx and<br>> > >> development.xxx/production.xxx files? My app uses a couple of databases<br>> > >> with passwords that are changed on a regular basis, and I'd like to be<br>> > able<br>> > >> to drop DB config files into the environments folder and have them<br>> > >> automatically included rather than having to edit config files by hand<br>> > or<br>> > >> regenerate them by script. If there's something that already exists<br>> > that I<br>> > >> can use, that would be great!<br>> > >><br>> > >> Thanks!<br>> > >> Amelia.<br><br></div></div></div>