Strange it didn't work when I tried it yesterday, but now it did. Probably I made some mistakes and arrived at the wrong conclusion.
It is especially sad as I have this exact example in my slides as well.

Well, I should rely more on my own examples :)

Thanks for your quick response and making me try it again!

Gabor


On Mon, Feb 8, 2021 at 11:10 PM Jason A. Crome <jason@crome-plated.com> wrote:
I am going to guess I am missing something obvious you are trying to do, but why can't you do this:

myapp:
    url: http://galaxy.com
    token: 42

in any config file in your Dancer2 application?  I'll do this in config.yml if I have settings across all environments, in config_local.yml for settings I don't add to version control, and in my environment yaml files when such settings are environment specific. Put that in any config file and you can simply use config->{ myapp }{ url }, etc. in your Dancer2 app.

I feel like I am missing what you are trying to do somehow. Let me know.
Jason

On Mon, Feb 8, 2021, at 4:00 PM, Gabor Szabo wrote:
e.g. My applications uses some external system and I'd like to read its URL and the token I need to access it from some config file.

I looked at the generated config files, and the only solution I could come up with is to put it under "plugins" like this:

plugins:
  MyApp:
      url: http://galaxy.com/
      token: 42

I don't really like it.
What is the recommended way to do it?

Gabor

_______________________________________________
dancer-users mailing list



_______________________________________________
dancer-users mailing list
dancer-users@lists.preshweb.co.uk
https://lists.preshweb.co.uk/mailman/listinfo/dancer-users