https://kotlinlang.org logo
#ktor
Title
# ktor
p

Philipp Mayer

05/17/2020, 1:24 PM
How can I expose data from within the Application module scope? Lets say I do the following:
Copy code
fun Application.adapter() {
    val topic: SomeObject = SomeObject(environmnet.config.property("something").getString())
}
and I want to use the topic Object in a different class (a koin module). I just have the feeling that I'm missing a fundamental concept here.. I just found that github issue, but that doesn't really help me. https://github.com/ktorio/ktor/issues/1448
My current solution is:
ConfigFactory.load().getString("property.name")
Works, but I still wonder if I missed something there.
2 Views