简体   繁体   中英

Add entries on application.conf runtime. Is it possible?

I need to add some entries on application.conf on runtime. Is it possible? How?

I can not add those entries because i need to load them from database and i'll load it when application starts.

Thank in advance

Then why you do you put them in application.conf but not in a object or trait ? Something like:

object ConfigFromDB {
    val config_val: Option[String] = loadfromdb()
    private def loadfromdb() = ...
}

or

trait ConfigFromDB {
    val config_val: Option[String] = loadfromdb()
    private def loadfromdb() = ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM