Reputation: 136
Is there any way to get early access to configuration (before com.typesafe.config.Config.resolve() would be called)? I would like to provide custom behavior when unresolved substitutions are encountered during resolution (link to feature in typesafe config)
I am using Play 2.6.x
Thanks for any help.
Upvotes: 1
Views: 162
Reputation: 3251
Currently there is no place in Play to access configuration that early. The configuration is loaded by DevServerStart
/ProdServerStart
using hard coded loading logic and passed to the ServerProvider
and the ApplicationLoader
.
The ApplicationLoader
(Java, Scala) does have the ability to rewrite configuration if that works for you.
We could add support for a custom ConfigResolver
as a new feature in Play. It would probably have to be driven from a system property to find the correct class. If you'd like this feature, please create an issue.
Upvotes: 2