[dancer-users] How to add application-specific config values to config.yml? and the environments/* files?
Jason A. Crome
jason at crome-plated.com
Mon Feb 8 21:10:20 EST 2021
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 at lists.preshweb.co.uk
> https://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
--
Jason A. Crome / CromeDome
CPAN: https://metacpan.org/author/CROMEDOME
GitHub: https://github.com/cromedome
Twitter: https://twitter.com/cromedome
Blog: https://cromedome.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20210208/0d03b7c0/attachment.htm>
More information about the dancer-users
mailing list